Topics and lessons

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 no-reply@triggre.com or noreply@triggre.com:

  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:
rule-editor
  1. The rule editor is already in add mode as you can see by the blue add button in the lower left corner.
  2. Click the green add button to add a step to the rule, which will show what you can add:
add-step-to-rule
  1. 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.
  2. Select property from user flow, then expand Current user and select Email:
select-property-from-user-flow
  1. This will add a value to your rule:
rule-editor-with-single-step
  1. 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.
  2. 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:
rule-editor-signs
  1. We choose Comparison sign and then we choose Equals:
rule-editor-comparison-signs
  1. Our rule is now updated with a comparison sign after the email:
rule-editor-with-step-and-equals
  1. 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:
rule-editor-add-specific-value
  1. Because Email is a text, Triggre will now ask you to enter a text as the specific value. We type no-reply@triggre.com:
add-specific-email-address-value
  1. When we have added the specific value, our rule now looks like this:
rule-editor-first-half
  1. To add another email address to be checked, we have to add an OR statement. We start by selecting the Equals sign:
rule-editor-start-add-or
  1. 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:
rule-editor-and-or-or
  1. We choose OR and now our rule looks like this:
rule-editor-with-or
  1. 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.
  2. Now repeat steps 2 – 5, using noreply@triggre.com as the specific email address. The rule will now look like this:
rule-editor-complete-rule
  1. 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.