A Salesforce Administrator needs to design a record-triggered flow that executes when an Opportunity status updates to 'Closed Won'. The flow must iterate through all associated Opportunity Line Item records, set a custom checkbox field `Renewal_Ready__c` to true, and commit the updates to the database while adhering to bulkification best practices. In what sequential order should the administrator configure the Flow Builder elements?
- 1Add a Get Records element to retrieve all Opportunity Line Items where OpportunityId equals $Record.Id.
- 2Add a Loop element to iterate through the retrieved collection of Opportunity Line Items.
- 3Add an Assignment element inside the loop to set Renewal_Ready__c = True on the current loop item and add the item to a new record collection variable.
- 4Add an Update Records element on the 'After Last' path of the Loop to update the new record collection variable.
Answer
The correct logical sequence is: 1) Query the related child records using Get Records, 2) Iterate over the record collection using a Loop element, 3) Update field values on the loop item and stage it in a new collection variable using an Assignment element inside the loop, and 4) Commit all updates with a single Update Records element after the loop completes.
To process related child records effectively without exceeding Salesforce governor limits, a flow must retrieve the child collection first, iterate using a Loop element, use Assignment elements inside the loop to update record values in memory and stage them into a collection variable, and finally execute a single Update Records element on the 'After Last' loop path.
Step-by-Step Solution
Key Concept
Bulkification in Flow Builder using Loops, Assignment elements, and Collection Variables