Store and expire flow variables
You'll save values you can reuse in later flow steps or visits, calculate new values with Liquid, and choose how long to keep them.
Save something about a visitor so you can use it later, such as the topic you last recommended. You can keep it for a set time instead of treating one visit's interest as a permanent preference.
For example, WorkForge (opens in a new tab) could save planning in a variable called last_topic for seven days. Variables live in the visitor's browser. They aren't permanent records or automatically shared across devices.
Open the flow you want to edit, and use a page with the RightMessage snippet installed for testing. Choose a name that's different from your flow scores. A same-named variable can override a score in High Score comparisons.
Save the value where you'll need it
Put the assignment before the offer or form that needs the value, so the visitor reaches it first.
- On the flow canvas, choose + on that path, then Set Data. On an empty canvas, choose Add the first step instead.
- Under Action Type, choose Add / Update Variable.
- Enter
last_topicin Variable Name:. - Enter
planningin Variable Value:. - Under Expires:, choose In..., enter
7, and choose Days. - Choose Done.
The screenshot includes a score adjustment as well as the seven-day variable. You only need the variable action to save last_topic.
The seven days start when the assignment runs, not when you read the value. Assigning it again replaces the value and restarts its expiration. A visitor who repeatedly reaches this step can keep extending its lifetime.
Never is the default. It stores no expiration timestamp, but browser storage can still be cleared. In... accepts a positive duration in Minutes, Hours, Days, or seven-day Weeks. Unset duration fields start at 1 hour. See the Set Data reference for the action fields and their limits.
Use the value in a later step
Enter {{ variable.last_topic }} in a text field that supports Liquid to read the saved topic. Add Data can insert variables found in the current flow, along with scores and input answers. A stored variable may still exist even if that flow's picker doesn't list it.
Keep the same variable name wherever you read or change it. Renaming the assignment creates a different stored key. It won't move the old value or update Liquid expressions you've typed elsewhere.
To count something, you can calculate the next value with Liquid. For example, this adds one to resource_views, starting at zero if it has no value:
Put the assignment where it should run. A system flow can run on page views, so use conditions if you want a once-per-person count rather than a page-view count.
Use score and variable conditions to match a value or check whether it exists. High Score can compare two or more numeric variables and converts numeric strings for that comparison. Text labels aren't meaningful highest or lowest values.
Remove a value when you no longer need it
To clear the variable, leave Variable Value: blank and make sure the visitor reaches that assignment. The Expires: control appears only when the value field isn't blank.
Deleting the Set Data node stops future assignments. It doesn't clear values visitors already have.
Variables are also separate from question answers and contact fields. Saving last_topic doesn't answer a question or assign an answer segment. Use Set Segment for a segment-backed answer. To update your email platform, use a supported Set Custom Field action or a mapped form field.
Use {{ variable.last_topic }} to read the variable and {{ score.planning }} to read the flow score. Those Liquid paths keep the two values separate, even though a same-named variable takes precedence in High Score comparisons.
Check the value and its expiration
Choose Preview on your site and inspect the saved value in the debugger.
- Reach the assignment, then check the value in the same browser.
- Visit another page and read it again.
- Try a short expiration interval and check the value after it expires.
- Test the blank-value removal separately.
- If you also update your email platform, check the identified contact's destination record.
When the value saves, reads back, and expires as intended, review and publish the draft.