Using the rule editor

In Triggre, rules are used in many places, from filtering the data you want to show in a table, looking up data to decisions. In this article, we show you how to make a rule for a decision. The same principles apply to all places you can use rules however.

The most important thing to know about rules, is that they can have different outcomes. When filtering data on a page, the rule has to be a true/false rule, meaning that the outcome for is either true, or false. All records of your data item for which the rule is true, are included, the ones for which the rule is false, are left out.

But there are more options. For a decision you can use a true/false rule too, but also a rule based on a pick list, a text, a date, time span and even a number. When you use a pick list as a rule in a decision, you can choose a path for each value of the pick list for example. And for numbers you can use specific numbers and ranges of numbers in paths.

How to use the rule editor

For now, let’s look at an example of how to make a true/false rule for a decision. We will make a rule, in a decision in a user flow, that indicates whether the current user has the email address or

  1. Add a decision to the user flow. You will now see the rule editor, indicating you should make a rule to base the decision on:
    Create a rule

  2. The rule editor is already in add mode as you can see by the blue add button in the lower left corner.

  3. Click the green add button to add a step to the rule, which will show what you can add:
    Add step to the rule

  4. As you can see, we only have the option to add a property from the user flow. If there are more options, they are shown here.

  5. Select property from user flow, then expand Current user and select Email :
    User flow property selection

  6. This will add a value to your rule:
    Value added

  7. When the value is selected, Triggre will show you the entire name and two add buttons to add a step before or after. When you deselect a step, the short name is shown only, in this case simply Email.

  8. Click the right add button to add a step after the Email. Note how Triggre always shows you only those options that are possible for you to add. In this case, we can choose a sign to add:
    Add a step

  9. We choose Comparison sign and then we choose Equals:
    Comparison signs

  10. Our rule is now updated with a comparison sign after the email:
    Rule overview

  11. Notice how the Email and add button are both surrounded by a gray marker. This indicates the left-hand side, and right-hand side of the equation. We click the green add button to add a Specific value:
    Add a step

  12. Because Email is a text, Triggre will now ask you to enter a text as the specific value. We type
    E-mail inclusion

  13. When we have added the specific value, our rule now looks like this:
    Rule overview

  14. To add another email address to be checked, we have to add an OR statement. We start by selecting the Equals sign:
    Equals sign selection

  15. Notice how again the left and right hand side of the equation are gray. When we now click the right add button, we can add an AND or OR statement:
    Logical signs

  16. We choose OR and now our rule looks like this:
    OR added to the rule

  17. Note how the OR also has the left-hand side and right hand side gray, but they are different than for the equals sign. This is very important to remember, because Triggre will automatically place brackets depending on which item in your rule you have selected.

  18. Now repeat steps 2 – 5, using as the specific email address. The rule will now look like this:
    Rule overview

  19. The rule is now finished. Click the blue add button to leave add mode in the rule editor, and finish the wizard.

Tip: Should you ever encounter a situation where Triggre places the brackets in a location you didn’t expect, it’s likely you can solve that by simply selecting another item of the rule and trying again.