The usage of list actions when dealing with several items in a shortcut allows you to generate ordered lists of data that are then passed on to the following step in the shortcut. iOS 15 Lets You View All Actions for Shortcuts in One List. List actions may also filter lists—either manually or automatically—by limiting the information sent to the next move. It is possible to do three list actions: the List action, the Choose from List action, and the Get-Item from List action.
The List action:
The List action allows you to build an ordered material list by adding text or injecting variables into the document. When the shortcut is used, the contents of the List action are passed on to the following step in the chain. Using the Quick Look action, you may preview each item in the list one at a time if you feed an index into it.
For example, the List action may create a primary menu of options for filling out a text field, or it could develop a series of album names from which to pick.
The List action has the additional capability of storing variables. Using the List action, for example, you may put together different material categories, such as a file, a picture, and a location, all in the same place. After that, you may pass that list into another action or utilize the elements in that list later on in the process.
It is possible to add a variable to a text string using the List action, and the variable will be converted to text and entered into the list item. It is pretty similar to manually add variables one at a time to a variable using the Add to Variable action when using the List action to arrange variables.
Actions from a drop-down menu are available for selection:
When the shortcut is executed, the Choose from List action may provide a menu of possibilities. Consider the following example: you might use the Get Future Events action to get iOS 15 off your upcoming Calendar events, then follow that action with the Choose from List action to choose the appropriate one. When you execute the shortcut, a menu of 15 Calendar events displays, inviting you to select one from the list.
When the shortcut is invoked, the Choose from List action may show rich previews (such as photos or map locations) in the menu of alternatives that are displayed. Use the Get Latest Photos action, for example, to acquire the five most recent photos from a photo album, then follow that action with the Choose from List action to choose the best image from the collection. A choice of five shots shows when the shortcut is activated, inviting you to select one from the list.
A Set Name action should be placed between the Get Latest Photos action and the Choose from List action if you want to provide a custom name to an object that an action outputs, such as an image in the Get Latest Photos action, for example. When the shortcut is executed, the picture returned from the Get Latest Photos action is given the custom name (rather than the default name, such as “IMG 0365”) specified in the shortcut.
Choose from List action in conjunction with the Dictionary action results in all of the keys in the dictionary is shown when you press “Add new item” while using the Dictionary action. For each key, you press, such as Number, Boolean, or Array, the values associated with that key are provided to the program as output. When you execute the shortcut, the Choose from List action shows the keys you specified in the Dictionary action in the Choose from List action.
When you act, Choose from List will ask you to choose a single item by default; however, you may enable Select Several to allow you to select multiple things when the action is executed. When Select Multiple is enabled, the ability to choose all of the options at once becomes accessible. Initialize the list with Select All turned on to have every item selected by default; then, when you execute the shortcut, manually deselect the things you don’t want to include in your list.
Action to get a specific item from a list:
To filter down a list of things, use the Get-Item from List action. Add a Get Item from List action to the shortcut editor after an effort with a list of choices. Then configure the Get-Item from List action to extract a single item from the list (the first item, last thing, a random item, and so on). The Get-Item from List action may also be configured to choose a list based on its index—the order in which it appears in the list. The first item in a list in Shortcuts has an index of 1.
By specifying a range of indexes, you may obtain numerous entries from the list at once. Get-Item from List action is used to acquire the third item in a six-item list whose index is 3, for example. Using the Get-Item from List action, you may obtain the third, fourth, fifth, and sixth items from the six-item list if you specify the index range to 3 to 6.