< All Topics

Decision Action

The “Decision” step is used to decide the path which you want to execute based on the logic you write in the decision step configuration.
The decision step can decide up to three paths. When you connect any step with the out ports of a decision step, you need to give a name to its path by clicking on that connection. Minimum two output paths are mandatory for the decision step, out of which one should be the default path.

Below is the property for this step:

Decision Logic

This property is used to write the logic to decide which path to execute based on the responses from the forms previous to this step.

Example 1 ( For Choice list) : Click on the “Decision step” and write the below code in the code editor using above property.

function decide(){
//enter code here
if(Choice.indexOf('Choice 1')!=-1)         // Choice 1 is the option present in the choice list in the form
    return 'Choice 1'                      // Choice 1 is the customized name given to the Path Value property
else if(Choice.indexOf('Choice 2')!=-1)
    return 'Choice 2'                      // Choice 2 is the customized name given to the Path Value property
else
    return 'Default'                       // Default is the Default path name
}

Steps to add the path name:

  1. Click on the connection path connected to an out port of the decision step.
  2. The connection properties, i.e. Path Value TypeDecision Path Value, and the Delete Connection button will be visible on the right side properties panel.
  3. Path Value Type has two options: Customized and Default.
  4. The customized option is used to give the customized path name. When you select this option, it will ask you the Decision Path Value property to give the name to the path.
  5. The default option is used to indicate the path as “Default”. If no any other path is returned by the decision logic, or if the logic fails in any case, this default path gets executed.

 

Table of Contents