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