Question

Difficulty: MediumFlow Resources and Data Manipulation

An administrator is designing an autolaunched flow that evaluates and modifies multiple active Contract records associated with an Account. To ensure the flow executes efficiently without exceeding governor limits when manipulating collection data, which two design practices should the administrator use? (Choose two.)

  1. Use an Assignment element inside the Loop to assign modified field values to a record variable and append it to a new collection variable.Answer
  2. Place an Update Records element after the Loop finishes to commit changes from the record collection variable in a single transaction.Answer
  3. C
    Place an Update Records element inside the Loop element immediately following each Contract record's field assignment.
  4. D
    Add a Get Records element inside the Loop to requery each Contract's parent Account details dynamically during each iteration.

Answer

The administrator should use an Assignment element inside the Loop to stage updated records into a new collection variable, and place an Update Records element after the Loop finishes to commit all updates in a single bulkified transaction.
Proper flow bulkification requires manipulating records in memory using Assignment elements and collection variables during loop iterations, followed by a single Update Records data element after the loop completes to persist the changes in a single DML statement.

Step-by-Step Solution

1
Retrieve related records before entering the loop
A collection containing all target Contract records is loaded into memory using a single Get Records element.
Bulkifying data retrieval outside iterative loops avoids exceeding the 100 SOQL query governor limit.
2
Modify records in memory and accumulate into a target collection variable
An Assignment element updates the loop item's field values and appends the modified item to a collection variable.
In-memory variable assignments consume no DML statements and prepare the batch for processing.
3
Commit all record changes outside the loop
An Update Records element positioned on the 'After Last Item' path updates all records in the collection in a single DML call.
Bulkified DML operations prevent hitting the 150 DML statement limit per transaction.

Key Concept

Bulkified Flow Data Manipulation and Collection Handling
Rate this question