How to Use the Repeat Action in iOS 12 Shortcuts

The Repeat action in the iOS 12 Shortcuts app allows you to automate repetitive tasks by executing a specific sequence of actions multiple times without manual intervention. This guide explains how to add standard loops and item-based loops to your workflows, arrange actions inside loop containers, and handle the output data generated by repeated actions.

Understanding the Two Repeat Actions

iOS 12 provides two distinct actions for creating loops:

  1. Repeat: Executes a set of actions a predetermined number of times.
  2. Repeat with Each: Takes a list of items (such as photos, text lines, or files) and executes the enclosed actions once for every individual item in the list.

How to Use the Standard Repeat Action

Use the standard Repeat action when you know exactly how many times an action needs to run, or when you want to determine that count using a variable.

  1. Open the Shortcuts app on your iOS 12 device.
  2. Create a new shortcut by tapping Create Shortcut, or tap an existing shortcut to edit it.
  3. Tap the Search bar at the bottom, type Repeat, and select the standard Repeat action.
  4. Two action blocks will appear in your workflow: Repeat [X] Times and End Repeat.
  5. Set the number of iterations by tapping the + or – buttons, or tap the number to type a specific count. You can also tap and hold the count to attach a numerical variable.
  6. Drag the actions you want to repeat directly between the Repeat and End Repeat blocks. Actions placed outside this boundary will not loop.

How to Use the Repeat with Each Action

Use the Repeat with Each action when processing a collection of data sequentially.

  1. Ensure your shortcut has an action that outputs a list (such as Get Latest Photos or Split Text) immediately before the loop.
  2. Search for and add the Repeat with Each action to your workflow.
  3. Notice that the top block reads Repeat with each item in [Input], followed by an End Repeat block.
  4. Drag your processing actions inside the container.
  5. Within the loop, tap any action parameter field and select the Repeat Item Magic Variable to reference the current item being processed.

Accessing Output from Loops

When a loop finishes executing, the End Repeat block gathers the output from every iteration and bundles it into a single list.

To use these aggregated results:

  • Add your next action directly beneath the End Repeat block.
  • Reference the output by selecting the Repeat Results variable to pass the combined data into downstream actions, such as saving files, creating notes, or displaying alerts.