Variable of an order in Code (Shopify Flows)

saantiago
Tourist
4 0 1

I am trying to place these values ​​in variables to be able to customize a dynamic WhatsApp url, I am using the "Runcode" action of Shopify Flows doing something like var order_total = "{{order_total}}"; How should it be done?

Reply 1 (1)

Tomas_Baena
Shopify Staff
6 2 3

Hi @saantiago, if I understand correctly you'd like to use the run code action to build a whatsapp url variable to be used later in the workflow. Below is an example of how you could assign the variable with data from the query, basically you can drop the "" and {{}}:

Tomas_Baena_2-1709131223061.png

 


If you're looking to interpolate multiple variables into a single string you can follow the same approach as the message field in the example above. If you haven't already I recommend checking out the help docs for this action here too, lots of useful information there. 

Hope this helps!
- Tomas

To learn more visit the Shopify Help Center or the Community Blog.