Repeater component can now be used to update existing record collections and not just create new records.
How: In Flow Builder, add a Repeater component in your screen and set a collection of records as the data source for the repeater component, and also decide
whether screen flow end users can add new items or remove prepopulated items in your Repeater instance. End users can always remove items that they added manually. Depending on the operations the screen flow end user performed, you can access the following output collections from the repeater component:
- Added, include all new items that were added by the end user. Prepopulated items are excluded from this list
- All Items, all items of the repeater instance. Both added and prepopulated items are included in this list
- Prepopulated Items, all items that was originally set as the data source for this repeater instance
- Removed Items, all items that were removed from the items that was originally set as the data source for this repeater instance
Example: Build a flow that will allow managing the account’s related contacts
To create the flow with the repeater component:
- Create a screen flow
- Create a recordId input variable in order to get the Id of the account triggering the flow
- Add a Get element to get all related to the triggering account contacts
- Add a Screen element with repeater component that has the following attributes
- Set the retrieved contacts as the repeater component data source
- Select if users can add new or remove prepopulated items
- Add the Name component to the repeater component and set the first and last name to be the retrieved contacts first and last name
- Add a Loop element that will iterate All Items collection of the repeater component and will add them in a new-updated temporary collection
- Add a Loop element that will iterate Removed Items collection of the repeater component and will add them in a removed temporary collection
- Add a Create Records element and configure it to create/update the contacts of the new-updated temporary collection (Update contacts with matching Id)
- Add a Delete Records element and configure it to delete the contacts of the removed temporary collection

