You might want to use different settings or values in your Lab and Main environment.
Examples are:
- 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.
To do so, in this lesson you’ll learn to:
- Create the Data item
- How to manage the Application settings
- Manage Application settings
- Use the Application settings
1. Create the Data item
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.
-
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:
2. 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:
3. 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:
4. Use the Application settings
There are two ways to make use of the Application settings:
- The values in the Application settings Data item are specific to the environment.
- 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:
The animation: