Have you ever had the need to update a group of records all at once? If you’re dealing with a sizable amount of records, you can’t get by using multiple Record Updates. The easiest and most efficient way to do this is to use a Fast Update. A Fast Update allows us to update hundreds of records at once all within one Flow!
For instance, what if we were using List Views in order to determine which Leads to call? We have multiple Leads associated to the same Company AND we don’t want to call a Company more than once a day. To solve this we would want to use a Fast Update to mark a checkbox on the related Leads that would ‘remove them’ from our List View for 24 hours. While we will have this full business case listed as a Flows in Action post in the near future, we are going to be just covering the pieces inside our Flow.
If you have not yet read Fast Lookup and Loops, you might want to take a look at them. This post is focused on how we get our Fast Update to work, and not so much how we query or loop through the records. I will be showing the ‘finished’ Fast Lookup and Loop so that you have it as reference in terms of what Variables were used.
So, how do we add records into a SObject Collection Variable that can be used in our Fast Update? Well, we do it the same we do in our Fast Create, we just switch up what we’re doing slightly. So lets get started by adding in our First Assignment Element into our Flow!
In our first Assignment Element we are using our previously created SObject Variable (Related_Lead), and we are assigning the Company Called Last 24hrs field as TRUE. If we had a formula or other value we wanted to update on the record we could also add that in, but in this situation we’re keeping it simple.
In our second Assignment Element we are adding the SObject Variable we just updated to our new SObject Collection Variable that we are going to use in our Fast Update. If you’re used to doing data loads, think of this as adding a row to an excel sheet. Every time you are looping through a Lead record, we are updating the data (as you saw in the previous element) and adding it as a row in our collection of Assets for the Fast Update (as you see in this element).
Now we need to finish this by dragging out the Fast Update element (under the DATA section of the Palette).
Set your SObject Collection Variable to be the Variable in your Fast Update and you’re done!
Take a look at what the finished Flow looks like:
RECAP: Fast Update elements let you update a batch of records in your Flow. I like to think of the process as adding rows to an Excel sheet. Every time I go through my Loop, I am adding an additional row to the Excel sheet. My columns are the what I set in the first Assignment element. This means if you want to include a field you must assign it. This ‘final’ Excel sheet will be what I am going to insert into Salesforce. So, a Fast Update is like doing an update of records in Workbench or Dataloader.