Question

Difficulty: MediumFlow Resources and Data Manipulation

An administrator is designing a Screen Flow that allows customer support agents to generate follow-up Task records for multiple Contacts linked to an escalated Case. The flow must process all selected Contacts and create the corresponding Tasks efficiently without hitting governor limits. Which design pattern should the administrator implement using Flow resources and data elements?

  1. A
    Place a Create Records element directly inside the Loop element to immediately insert each Task record as each Contact is processed.
  2. B
    Configure an after-save Record-Triggered Flow with an Update Records element on the parent Case to automatically invoke the creation of individual Tasks.
  3. Populate a Task record variable within a Loop element, add it to a Task record collection variable using an Assignment element, and execute a single Create Records element after the Loop.Answer
  4. D
    Rely on custom validation rules configured to fire after the Create Records element inside the Loop to roll back transactions whenever volume exceeds limits.

Answer

Populate a Task record variable within a Loop element, add it to a Task record collection variable using an Assignment element, and execute a single Create Records element after the Loop.
Salesforce best practices dictate that Flows must be bulkified. By utilizing an Assignment element inside the loop to add each individual record variable to a record collection variable, the database insert can be deferred until the loop finishes. A single Create Records element pointing to the collection variable consumes only one DML statement regardless of the number of items.

Step-by-Step Solution

1
Iterate over the selected Contacts using a Loop element
Each Contact record is processed sequentially within the Flow loop
Allows mapping Contact-specific field values to individual Task properties
2
Assign Task field values to a single Task Record Variable and append it to a Task Record Collection Variable
The Task Record Collection Variable accumulates all new Task records in memory without committing DML statements
Stores pending records in Flow resources to prepare for a single bulkified operation
3
Connect the 'After Last Item' path of the Loop element to a single Create Records element referencing the Task Record Collection Variable
All Task records are inserted into the database in a single DML transaction
Adheres to Salesforce bulkification best practices and respects transaction governor limits

Key Concept

Flow Bulkification and Collection Manipulation
Estimated Time:1m 15s
Rate this question