Flow Loops Just Got Simpler

Actually, I don’t know when this change happened, but I just noticed that Flow loops now only have four steps instead of five. The two assignments can now be consolidated into one.

You still have to add the record to a collection, but you can use the same assignment element.

Example 1: Update the record currently in the loop.

  1. Use a Get Records element to create a collection of records to loop through.
  2. Add a loop element
  3. Add ONE assignment element
    • Update field values for record currently in the loop.
    • Create a new record collection variable to hold the records you want to update.
    • Use the same assignment element to add the record currently in the loop to the new collection.
  4. Add an Update Records element to update the records in your new collection.

Follow my blog to keep up to date on Flow and Salesforce


Example 2: Create new records.

  1. Use a Get Records element to create a collection of records to loop through.
  2. Add a loop element
  3. Add ONE assignment element
    • Create a new record variable (not collection) to hold the values of the new record you want to create.
    • Assign field values to your new record variable.
    • Create a new record collection variable to hold your records that you want to create.
    • Use the same assignment element to add the record currently in the loop to the new collection.
    • Close the loop.
  4. Add a Create Records element to create the records in your new collection.

Previously step 3 involved two assignment elements!

Watch this recording on Flow loops.

This is how you would combine steps 3 and 4 into one assignment!

Published by

JessieRymph

Jessie joined Salesforce.org in 2018 to give introductory webinars to nonprofit customers. She now is a Senior Solution Developer supporting nonprofits and education customers at Salesforce. All opinions expressed on this blog are her own or those of the contributors. She's spent 17 years more or less in CRMs and databases, but didn't meet Salesforce until 2011. Jessie co-led the Seattle Salesforce Nonprofit User Group in 2015-2016. She wrote a sh*tty first draft of a novel and hopes to turn it into a screenplay!

2 thoughts on “Flow Loops Just Got Simpler”

Leave a Reply