Using different logic on Main and Lab
You might want to use different settings or values in your Lab and Main environment.
- the From and BCC-addresses in email messages;
- a flag that allows the system to send emails;
- URLs that differ in Lab and Main;
- the current year (for testing purposes);
- interface tokens (Zapier, Stripe etc.);
- defining the environment (lab/main), so you can create different paths in flow parts based on the environment.
Start with creating a data item called Application settings to store those properties. During the execution of a user flow or flow part you can look up these settings after which the flow can use them.
Create the data item
Go to Design and then Data.
Add the data item.
Add properties. You can add properties that might be different in either environment. Examples are:
How to manage the application settings
Create a user flow as below to make sure that both in Lab and Main you have exactly one item in which the values for Lab or Main are stored. Before you create the user flow, you create a flow part that counts the number of items in Application settings and add this check to the Application settings user flow.
Create the flow part that counts the items in Application settings
Create a flow part and rename it to Applications Settings count items.
Create a look up on Application settings with a list as outcome.
Create a calculation that counts the number of items in the look up.
Output the result of the calculation.
Create the user flow Application settings
Create the user flow Application settings.
Using the user flow wizard, create a user flow for Application settings allowing Add, Delete and Edit.
Insert the flow part you just created right after Start. It will count the number of items in Application settings.
Modify the Add button to use an additional rule: Number of items in Application settings < 1. This means that only when there is no item yet, you can add one.
Modify the Delete button to use an additional rule: Number of items in Application settings > 1 (you don’t want to delete your precious application settings inadvertently).
Reroute Delete Application settings to Application settings count items.
Insert a page after the flow part: Warning: there is more than one item, delete excess items.
The additional rule for the Add button:
The additional rule for the Delete button:
Manage application settings
After you’ve published the design, you can manage the application settings. In both the Lab and Main environment you can enter the environment-specific values and use them in your application.
Using the example above, the settings might look like below:
Use the application settings
There are two ways to make use of the application settings:
1. The values in the Application settings data item are specific to the environment, or,
2. The environment you are in defines the routing in the flow.
The values in the Application settings data item are specific to the environment
This might be the case for interface tokens, urls and email addresses. Another example is that you only want Triggre to send test messages in the Lab environment.
The routing in a flow depends on the Triggre environment
In example below, depending on which environment it is, Triggre will calculate an Email to address and a Subject for the email message.
After that, the Data flow composes the email, using the values it calculated in the appropriate branche.
Create a look up in the flow part on Application settings.
Do not use a rule.
Select A single Application Settings.
Do not sort.
Give the look up a name.
Depending on the value of Application settings | Triggre environment, calculate the Email to and the Subject.
Then create a Send Email. Use the calculation Email to and the Subject (Triggre will automatically use the one based on the route followed) and retrieve the From and BCC from the Application settings.
The flow part: