Question

Difficulty: EasyFlow Builder Elements and Logic

A Salesforce Administrator is configuring an autolaunched flow to update inactive Contact records. To ensure the flow is properly bulkified and avoids hitting DML governor limits, place the following Flow Builder steps in the correct logical execution sequence from first to last.

  1. 1Get Records element to query all matching inactive Contact records into a collection variable.
  2. 2Loop element to iterate over each Contact record in the retrieved collection.
  3. 3Assignment element inside the loop to update field values on the current Contact item variable.
  4. 4Assignment element inside the loop to add the updated Contact item variable to a separate update collection variable.
  5. 5Update Records element placed after the loop to update the secondary collection variable in the database.

Answer

The correct logical sequence for bulkified record processing is: 1) Get Records to query the initial collection, 2) Loop to iterate through records, 3) Assignment to update field values on the current record variable, 4) Assignment to add the modified record to an update collection variable, and 5) Update Records outside the loop to commit all changes in a single operation.
The standard design pattern for processing multiple records in Salesforce Flow Builder requires fetching records first (Get Records), looping through them (Loop), updating field values and accumulating them into a new collection variable using Assignment elements inside the loop, and finally issuing a single update request (Update Records) outside the loop.

Step-by-Step Solution

1
Retrieve data using a Get Records element
Obtain a collection variable containing all targeted inactive Contact records.
Flow processing begins by identifying and pulling relevant records into flow memory.
2
Initialize iteration using a Loop element
Pass the retrieved Contact collection into a loop to process records one by one.
A loop is required to evaluate or modify individual record fields within a collection.
3
Modify record values using an Assignment element
Set the desired field values on the current item variable (e.g., $Record or current item from loop).
Field changes must be made to the current record variable in memory during each iteration.
4
Stage modified records using a second Assignment element
Append the current modified record variable to a new collection variable designated for updates.
Staging records in a collection variable allows all changes to be combined prior to database operations.
5
Persist changes using an Update Records element outside the loop
Perform a single DML update call on the staged collection variable after the loop finishes.
Placing the Update Records element outside the loop prevents hitting the 150 DML statement governor limit.

Key Concept

Bulkification Sequence in Flow Builder
Rate this question