SUPPORT.TWILIO.COM END OF LIFE NOTICE: This site, support.twilio.com, is scheduled to go End of Life on February 27, 2024. All Twilio Support content has been migrated to help.twilio.com, where you can continue to find helpful Support articles, API docs, and Twilio blog content, and escalate your issues to our Support team. We encourage you to update your bookmarks and begin using the new site today for all your Twilio Support needs.

How do I set variables in a Studio flow?

Objective

This article shows you how to add and configure the Set Variables widget so your Studio flow stores values it can reuse later — a customer name, a computed total, or a JSON object, and how to edit or remove those variables afterwards.

 

Product

Studio

 

Environment

Twilio Console

 

User Account Permission/Role(s) Required

Editing a flow requires the Studio flows create and update permissions on the account.

 

Procedure

  1. In the Twilio Console, select Orchestration in the left sidebar.
  2. Select Studio, then Flows.
  3. Select the flow you want to edit to open the Editor tab.
  4. Open the widget library and drag Set Variables onto the canvas.
  5. Select the new widget to open its configuration panel.
  6. To add a variable:
  7. Select Add variable.
  8. Enter the variable's name as the key and its content as the value.
  9. Select Parse as JSON Object if the value should be stored as structured JSON rather than a string.
  10. Select Save to add it to the variables table.
  11. Repeat for each variable you need. They all appear in the variables table in the panel.
  12. To change a variable, select its edit action in the table, adjust the key or value, and select Save.
  13. To remove a variable, select its delete action in the table and confirm with Delete.
  14. Select Save in the configuration panel.
  15. Open the Transitions tab and choose where the flow goes next for If next.
  16. Select Publish to make the change live.

 

Additional Information

  • Variables set here are available to every widget that runs after this one in the same execution.
  • Parse as JSON Object lets later widgets read individual fields out of the value instead of treating the whole thing as text.
  • You can add several variables to a single widget rather than chaining multiple Set Variables widgets together.

 

 

This content was generated by AI and reviewed, edited, and verified by a human.

Have more questions? Submit a request
Powered by Zendesk