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:
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 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 the user flow Application settings
The additional rule for the Add button:
The additional rule for the Delete button:
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:
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.
The flow part:
The animation: