The new Flow Builder is coming in Spring ’19 to replace the Flash dependent Cloud Flow Designer interface to create and manage flows.
Note: I cover the high level summary of the differences between Cloud Flow Designer and Flow Builder in my blog post: Move Over Cloud Flow Designer, Here Comes the New Flow Builder.
Let’s take a closer look at a flow I created in Cloud Flow Designer and how this now looks in the new Flow Builder, specifically handling multiple records in a collection.
This flow uses the Fast Create, Fast Update, Fast Lookup and Fast Delete flow elements. These are DML actions that occur with a collection of Salesforce records.
In the new Flow Builder, this same flow looks like this:
The Fast Lookup in Cloud Flow Designer looks up the Contact object where the AccountId equals the variable recordId and then saves the Id in the variable.
The same flow element in the new Flow Builder is now using the Get Record flow element, which looks like this:
Get Record combines the Cloud Flow Designer’s Record Lookup and Fast Lookup into one flow element.
If you are looking to work with multiple records, select “All records” for How Many Records to Store. Then in the Select Variable to Store Contact Records, select the record variable. Also, to set a null value if no records found, check the box “When no records are returned, set specified variables to null.”
Here is the record variable meant to store a collection of records.
In a Fast Update flow element in Cloud Flow Designer updates the Contact records in the sObject Collection Variable {!sObjUpdateContacts}. It will update the Premier Client custom field.
In Flow Builder, this is now a Update Record flow element, which looks like this:
The Update Record flow element combines Cloud Flow Designer’s Record Update and Fast Update into one flow element.
When updating multiple Salesforce records, select “Use the IDs and all field values from a record variable or record collection variable” under How to Find Records to Update and Set Their Values.
Under the Select Variable section, select the record collection variable {!sObjUpdateContacts} to store the Salesforce records.
Here is the record variable meant to store a collection of records to update.
In a Record Create flow element in Cloud Flow Designer creates a record in the Task object and sets the AccountId, OwnerId, Subject, Priority, WhoId and Activity Date fields with the assignment flow element. It will create a collection of Task Records stored in the record variable {!sObjColTaskToBeCreated}.
In Flow Builder, this converts to the Create Records flow element, which looks like this:
The Create Records flow element combines Cloud Flow Designer’s Record Create and Fast Create into one flow element.
If you want to create multiple Salesforce records, select “Multiple” under How Many Records to Create and select a record variable under Select Variable. In our solution, we are creating task records that are contained in the record collection variable {!sObjColTaskToBeCreated}.
Here is the record variable meant to store a collection of records to create.
Lastly, the flow element Fast Delete in Cloud Flow Designer deletes multiple Salesforce records from the Case object that are contained in a sobject collection variable {!sObjColDeleteCollection}.
The Fast Delete translates into the Delete Records flow element in Flow Builder, which looks like this:
Delete Records combines the Cloud Flow Designer’s Record Delete and Fast Delete into one flow element.
To delete multiple Salesforce records, select “Use the IDs stored in a record variable or record collection variable” under How to Find Records to Delete. Under the Select Variable section, select the record variable or record collection variable. In our case, we will select the record collection variable {!sObjColDeleteCollection}.
Here is the record variable meant to store a collection of records to delete.