Variables in Flowsteps

You can use variables in Flowsteps to control the way those Flowsteps work. You can set conditions to trigger the flowstep, add information from the data to subject lines and much more.

You can use data and variables from various sources:

  • The data you push into SendPro, visible in the Data tab of the message

  • Any data you process in Json data templates (see below)

  • Any data that’s created or pulled by previous Flowsteps in the same flow

  • Standard SendPro variables, such as ${flowmailer.account.id} and ${currentMessage.recipient}

In Flowsteps, you can use these variables in Condition fields, and in any field marked Enabled expression, or marked Dynamic.

The easy version: Flowstep conditions

Sometimes, you only want a Flowstep to trigger under certain conditions. For example, only change the Subject Line if the order contains a certain product. Each flowstep has a Conditions checkbox, where you can trigger the flowstep if certain values are present in the data.

Example: Let’s say your data contains the variable digitalProduct, which tells you wether or not the product is purely digital, and included as a download in the message. You could then set up a Subject Flowstep, that changes the subject to: ‘Your Digital Download is ready’. Under Advanced in the Flowstep, check ‘Set condition for this FlowStep’ and type digitalProduct == true into the field.

Settings_Subject.png

The more complicated version: Data templates

You can create variable useable by Flowsteps by using a separate data template. You create one by choosing JSON Data type instead of HTML when creating a new template:

Json data template.png
In that template you then put code like this: ${toJson(subjectlines)} or ${toJson(.main)}


Example: You can fill your data template with any logic needed to produce your subjectline. Let’s assume you end up with the variable mySubjectline = “Your Digital Download is ready”. Using the code ${toJson(mySubjectline)} you tell the Data template to push the variable to the global data. In the Flows, you then place a Subject Flowstep, that changes the subjectline to ${mySubjectline}.

Of course, you can do an include in your JSON template, so you can use information from another template.