Loop: apply to each action executes a block of actions for each item in the iterating array.
Example of Loop: apply to each action configuration with SharePoint list items
For more information about Action Builder read Action Builder introduction article.
To configure the action Loop: apply to each additional property should be specified:
Configuration
Property | Required | Type | Description |
Iterating array |
yes | Array |
Need to specify an array or select an output from previous actions. This can be the output of a Get Items action, a variable having an array, a multi lookup field, a multi choice field or just an array directly calculated in this property. |
Availability
Modern Forms | List Actions | Scheduled/Triggered Actions |
✓ | ✓ | ✓ |
Output
Output Parameter | Type | Description |
CurrentItem | Object | Returns an element from the iterating array |
Index | Number | Returns an iteration number of element |
Count | Number | Returns total iterations number |
Note: Outputs available for actions inside Loop: apply to each action
Examples:
Loop: apply to each action is usually used with Get items action. In this case, since CurrentItem output from the Loop: apply to each action is an object representing an element from the iterated array, you need to specify a property to extract its value:
[[@Actions.Loop_apply_to_each.CurrentItem]].ID
To retrieve all available properties, you can turn on Debug mode in Action builder, then open Console tab in developer tools (F12) in the SharePoint site and execute Get items action.
This is an example of using multi person field. With the same format, you can also use multi lookup, multi choice or simply an array.