If-Then steps

An If-Then step runs nested steps when a given condition. The nested steps only run if the specified event occurs, otherwise the If-Then step is skipped and the flow continues. For example, you can create an If-Then step that captures the email field on a Formstack form; checks that the email isn't a personal address ending with @gmail.com, @yahoo.com, or @hotmail.com; and if not, adds the email to a Mailchimp list.

  1. In a flow step, choose If-Then from the Step menumenu.

  2. Choose the step data object for the If statement.

  3. Choose a condition to be met.
    See Conditions table below for possible conditions.

  4. Enter a value or choose a step data object.

  5. (Optional) Continue to add AND or OR statements.

  6. Click Save.

  7. In the If step, choose Rename from the Action menu menu, enter a description, then click Rename.

Conditions

Text Number Date Boolean Other
  • Text: Includes Case-Sensitive

  • Text: Includes Case-Insensitive

  • Text: Excludes Case-Sensitive

  • Text: Excludes Case-Insensitive

  • Text: Equal to Case-Sensitive

  • Text: Equal to Case-Insensitive

  • Text: Not Equal to Case-Sensitive

  • Text: Not Equal to Case-Insensitive

  • Text: Begins with

  • Text: Does not Begin with

  • Text: Ends with

  • Text: Does not End with

  • Text: Is empty

  • Regex: Match Expression

  • Number: Equal to

  • Number: Greater than

  • Number: Less than

  • Date: Equal to

  • Date: Not Equal to

  • Date: Less than

  • Date: Greater than

  • Boolean: True

  • Boolean: False

  • Is this a URL

  • Is this an Email

  • Is this not an Email

  • Is Null

  • Exists

  • Does not Exist

  • Is a List

  • Is an Empty List

  • List Length Equal

Example 1 

Below is an example of how to use an If-Then step in a flow, using the Formstack to Mailchimp scenario described at the top of the page.

  1. In a project, create a new flow and name it New subscriber on new form entry.

  2. Choose the Formstack connector from the list of connectors, choose the New form submission trigger, then click Continue.

  3. Connect your Formstack account, then click Continue.

  4. Choose the form you want to use from the list, test the trigger by submitting a test submission, then click Save Trigger.

  5. From the New form submission step, choose If-Then from the Step menu menu.

  6. In the lefthand field, choose the Email step data block from the New form submission step.

    If statement, Email step data

  7. In the middle field, choose Text: Includes Case-Sensitive from the list of conditions.

  8. In the righthand field, enter '@gmail.com'

  9. Add two OR statements by clicking + Add OR Statement twice.

  10. Use the same step data and condition as before, then enter '@yahoo.com' into the righthand field of the second statement and '@hotmail.com' into the righthand field of the third statement.

    If step, multiple OR conditions with specified values

  11. Click Save.

  12. From the If step, add a new action step from the Step menu menu.

    Here, you see two different places to add the step. Adding the action as a step nested within the If step will cause the action to be performed when the condition is true. Adding the action as a step outside of the If step will cause it to be performed as normal in the flow. In this example, we want to add the step outside of the If step so that it runs as normal. In other words, when Email contains any of the text specified in the three statements (@gmail.com, @yahoo.com, or @hotmail.com), the condition is true, but, because there is no nested substep in the If step, no action will be performed. So, to add emails that don't contain the specified text to the mailing list, the Mailchimp action should be placed outside of the If step so that it's performed as it normally would be, irrespective of the conditions specified in the If step.

    If step, execute action when condition is true or false

  13. Click Execute Action when condition is false, choose the Mailchimp connector, choose the Subscribe to audience action, then click Continue.

  14. Connect your Mailchimp account, then click Continue.

  15. In the Audience field, choose an audience from the list.

  16. Next to the Email field, click , then choose the Email step data block from the New form submission step.

    Subscribe to audience, Email step data

  17. Configure other fields as necessary, then click Save.

  18. Finally, click the toggle above the flow to enable it.

Now, when a user submits the specified Formstack form where the Email field does not contain @gmail.com, @yahoo.com, or @hotmail.com, the user will be added to the chosen Mailchimp audience.

Notes 

  • If-Then steps only apply to a single condition, with one or more statements, and do not function like else if loops in programming languages like Python or JavaScript. For multiple conditions, use multiple If-Then steps.