Skip to main content

4. Define Logic

To add logic for your flow, you can use Expressions in Decision node called Condition.

Our app should do the following thing:

If a user with an email a@gmail.com, then go comments node, where it will create a Zendesk ticket.

If a user with other emails, then go selecting date node, where the message will be sent to Slack.

There are two ways to define the logic: Code and Expression.

Define Logic as Code

  • Open Condition node
  • Go to Expression
  • Choose Rule as Code
  • Write JS code as following:
if (ctx.USER_INPUTS.email == 'a@gmail.com'){ 
return 1;
}
else {
return 2;
}

code

Define Logic as Expression

  • Open Condition node
  • Go to Expression
  • Choose Rule as Expression
  • In the expression, set the condition (as shown in the picture)

img.png