Updated
How to Filter a List in Shortcuts on iPhone and Mac
By Sindre Sorhus, who makes the Actions app
With Actions
- Install Actions, and open it once.
- In your shortcut, add the “Filter List” action below the action that makes the list, and select the list in the action.
- Choose “Keep” to keep the items that match, or “Remove” to remove them.
- Choose the condition: “contains”, “begins with”, “ends with”, “is”, or “matches regex”. Then type the text.
The result is “Filtered List”, in the same order as the list. Upper and lower case do not matter, unless you turn on “Case Sensitive”. To keep only the first matches, turn on “Limit”.
Tips
- The action is for a list of text and numbers. For a list of dictionaries, like the result of a JSON API, use “Filter List of Dictionaries”.
- If Shortcuts says that it “couldn’t convert from Text to NSString”, change the preview of the result to the list view. This is a bug in the Shortcuts app.
- To remove the items that are in the list two times, use “Remove Duplicates from List”.
Get Actions
Additional actions for the Shortcuts app
Free
- Requires
- macOS, iOS, or visionOS 26 or later
- Privacy
- No personal data collected
- Updated
- June 2026
- US App Store rating
- 4.8/5 (703 ratings)
Without an app
The “Filter” actions of Shortcuts, like “Filter Files”, are only for files, photos, and other content, not for a list of text. Use a loop:
- Add the “Repeat with Each” action, and select the list.
- In the loop, add an “If” action. Use “Repeat Item” as the input, choose a condition, like “contains”, and type the text.
- In the “If” part, add the “Add to Variable” action with “Repeat Item”, and name the variable, like “Filtered”.
- After “End Repeat”, use the variable.
This works, but it is three actions for each filter, and “If” has no condition for a regular expression. For a regular expression, combine the list with “Combine Text”, and use “Match Text”.
