Adjust variables in Shortcuts
The variable editor appears at the bottom of the shortcut editor, allowing you to access controls to set the content type, choose which details of the content to extract, rename the variable, or reveal the action that generated the variable.
Change a variable’s content type
Shortcuts automatically detects the type of content stored in a variable and uses that content as the variable’s default content type. You can force the variable to change content types.
In the Shortcuts app Library , tap on the shortcut you want to modify.
In the shortcut editor, tap a variable token.
The variable editor appears at the bottom of the screen. Below the name of the variable, a highlighted button named “as [variable type] >” indicates the content type used by the variable. For example, the Article from Webpage variable displays “as Article >” as its variable type.
Tap “as [variable type] >” and then tap a new content type for the variable in the list that appears.
Note: If you choose a custom content type, Shortcuts uses its Content Graph technology to convert the content of the variable to the selected variable type. For example, if you have a variable that stores a URL, you can change its content type from URL to Article. Shortcuts will automatically fetch details about the article at that URL.
Choose a variable’s content details
In the Shortcuts app Library , tap on the shortcut you want to modify.
In the shortcut editor, tap a variable token.
The variable editor appears. The properties offered by the specific content type are listed below the variable’s title and content type. This list represents all of the available metadata associated with your content, allowing you to choose which property to use as the output of the variable.
For example, an Image variable offers properties such as Width, Height, Date Taken, Location, and Camera Make. Each content type offers its own set of properties.
Each content type has a default property that’s automatically extracted if nothing else is chosen.
Tap a property in the list.
The variable token is updated to indicate your preference.
Tip: You can manually grab properties from any action’s output by using the Get Details actions, such as Get Details of Safari Webpage or Get Details of Images. Browsing these actions is also a helpful way to explore which details you can extract for each content type.
Rename a variable
In the Shortcuts app Library , tap on the shortcut you want to modify.
In the shortcut editor, tap a variable token.
The variable editor appears.
Tap Rename, tap , then enter the new name for the variable.
Tap OK.
All instances of the variable are renamed.
Reveal the action that generated a variable
In longer shortcuts that contain multiple variables, you can use the Reveal Action button to show the original action that produced a variable.
In the Shortcuts app Library , tap on the shortcut you want to modify.
In the shortcut editor, tap a variable token.
The variable editor appears.
Tap Reveal Action.
The shortcut editor scrolls up and highlights the source action of the variable.
Once you’ve grasped how to add, place, and adjust variables, you’ll begin to see how variables make your shortcuts much more dynamic. You can reuse content multiple times, easily extract particular details from the content, and place that content anywhere in your shortcut.
Variables let you make shortcuts that are capable of adapting to a variety of situations, adjusting content on the fly while still yielding the results you want.
Tip: If you’re just getting started with variables, it may be helpful to experiment with an existing shortcut that includes variables. Add a shortcut from the Gallery , then reorder the actions or add new variables to see how the shortcut is affected.