Question

Difficulty: HardFlow Builder Elements and Logic

A Salesforce Administrator needs to design a flow that processes a collection of child Case records associated with an Account. The flow must aggregate estimated resolution hours from all related open cases, update a summary field on the parent Account, and set the Status of each open Case to 'Escalated'. Which TWO design strategies should the administrator implement within Flow Builder to fulfill these requirements without exceeding governor limits? (Select 2 answers.)

  1. Execute a single Get Records element prior to the Loop element to retrieve all related open Case records into a record collection variable.Answer
  2. Use an Assignment element inside the Loop to update each Case record's field and add it to a new collection, followed by a single Update Records element outside the Loop.Answer
  3. C
    Place an Update Records element inside the Loop element directly after modifying each individual Case record's Status field.
  4. D
    Configure a Roll-Up Summary field on the Account object to aggregate estimated resolution hours from Case records connected via the standard lookup relationship.

Answer

The correct strategies are retrieving all related records using a single Get Records element before entering the loop, and using an Assignment element inside the loop to build a record collection that is updated using a single Update Records element after the loop finishes.
To ensure flows scale safely when handling multiple records, administrators must bulkify logic by performing all SOQL queries (Get Records) and DML statements (Update/Create/Delete Records) outside of Loop elements. Gathering related records before the loop and performing a single batch update on a collection variable after the loop ensures adherence to transaction governor limits.

Step-by-Step Solution

1
Query records outside the loop
A single Get Records element retrieves all target Case records into a record collection prior to loop entry, consuming only 1 SOQL query.
Placing data queries outside loops prevents transaction failure caused by SOQL governor limits.
2
Iterate and accumulate in memory
The Loop element iterates through the collection while an Assignment element adds values to a running total variable and pushes updated Case record instances into a new collection variable.
Field values and collections can be modified in memory during loop execution without issuing DML calls.
3
Perform bulk DML operations after the loop
A single Update Records element executes on the accumulated collection variable after the loop terminates.
Executing database updates in bulk outside the loop uses only 1 DML statement out of the allowed limit per transaction.

Key Concept

Flow Bulkification and Governor Limits
Rate this question