If Activity Scripting

The If activity checks conditions to determine which transition to follow

  • Yes
  • No

Example:

Condition
    Price less than or is 1000
// This script needs to set answer to 'yes' or 'no' to indicate the state of the activity
// For example
answer = ifScript();
function ifScript(){
    if(condition is true){
        return 'yes';
    }
    return 'no';
}

The decision about which path to take depends on the Condition and Advanced/Script fields.

Use the Condition builder whenever possible for faster performance. If the condition exceeds the abilities of the Condition builder, select the Advanced/Script fields to script the condition(s).

In the Condition builder shown, if Price is less than or is 100, the Yes transition will take place. Otherwise the No transition will occur.

In the Script shown above, the comments explain if the condition is true, the return value is yes and the Yes transition will take place. If the condition is not true, the return value is no and the No transition will occur.

IMPORTANT

If both the Condition and the Script fields have values, both fields must return yes for the 'Yes' transition to be taken.

results matching ""

    No results matching ""