Question

Difficulty: MediumFlow Builder Elements and Logic

A Salesforce Administrator needs to build a daily Schedule-Triggered Flow that processes expired Subscription custom records and updates their parent Account records with the aggregated renewal values. The Subscription object is related to Account via a Lookup relationship. Which design approach using Flow Builder elements accurately satisfies this requirement while respecting governor limits?

  1. Use a Loop element to iterate through the retrieved Subscriptions, an Assignment element inside the loop to calculate updated values into record variables, and a single Update Records element placed after the loop finishes.Answer
  2. B
    Place an Update Records element inside the Loop element to immediately save changes to each parent Account record during every iteration.
  3. C
    Create a Roll-Up Summary field on the Account object to automatically calculate the total subscription sum without needing Flow Builder logic.
  4. D
    Use an Assignment element inside the loop to commit field modifications directly to the database without needing an Update Records element.

Answer

Use a Loop element to iterate through retrieved records, an Assignment element inside the loop to modify values in memory, and an Update Records element outside the loop to execute a single bulkified DML operation.
The correct approach bulkifies the flow by utilizing an Assignment element within the loop to calculate aggregate values in memory, followed by executing a single Update Records element outside of the loop after iteration concludes.

Step-by-Step Solution

1
Evaluate relationship type constraints
Since Subscription and Account are connected via a Lookup relationship, standard Roll-Up Summary fields cannot be created on Account.
Roll-Up Summary fields require a Master-Detail relationship.
2
Design loop and assignment logic
Iterate through Subscription records with a Loop element and use an Assignment element to sum totals into flow variables.
Assignment elements perform in-memory calculations without consuming governor limits.
3
Place database operations outside the loop
Position the Update Records element after the loop path completes.
Bulkifying database operations by executing DML outside of loops avoids governor limit exceptions.

Key Concept

Flow Bulkification and Governor Limits
Rate this question