You are here:
Simultaneously Update Fields in Multiple Records Example
This example creates a flow that updates fields in multiple records by reassigning account ownership based on business rules.
Required Editions
First, create an Account-based record collection variable called
collReassignedAccts.
Next, add the Get Records element to get all account records that John Smith owns.
Then create a loop that iterates through the collection. For each item in the collection, the loop:
- Assigns the collection item to the loop variable.
- Evaluates whether the account has more than 10,000 employees.
- If the account has more than 10,000 employees, assigns Madison's user ID to the OwnerId field in the loop variable.
- If the account doesn't have more than 10,000 employees, assigns Amber's user ID to the OwnerId field in the loop variable.
-
Adds the loop variable's values as a new item in the
collReassignedAcctscollection. -
Finally, add an Update Records element to update the accounts in
collReassignedAcctswith the new OwnerId after the loop finishes iterating through the collection.This section of the flow uses a single query to look up the list of accounts and a single DML statement to update those accounts. If you updated the records by setting the fields individually, you would use:
One Update Records element to find all accounts that John owns and have more than 10,000 employees (1 query). Then update those records’ OwnerId to Madison’s Id (1 DML statement).
One Update Records element to find all accounts that John owns and don’t have more than 10,000 employees (1 query). Then update those records’ OwnerId to Amber’s Id (1 DML statement).

