What are variables in Shortcuts?
A variable is a container used to label and store content such as text, images, a web page or a dictionary of data.
When you create a shortcut using variables, actions in the shortcut aren’t required to follow a direct linear path of inputs and outputs — content can weave in and out of the shortcut at different points. For instance, the shortcut can store content at a certain point, perform an entirely independent set of actions, and then grab the original content in subsequent steps.
Using variables is the most powerful way to expand the capability of your shortcuts, allowing you to set up dynamic templates for content that autofill each time you use the shortcut. When a shortcut runs through its sequence of actions, it looks for any variables, retrieves the appropriate content for each variable, and then places the content inline, producing consistent results.
In Shortcuts, variables are represented by small tokens labelled with the name of the variable, such as Ask Each Time, Clipboard or Current Date. You place variables throughout the shortcut to mark where you want to set and retrieve content each time the shortcut is run.