Flow: How To Use “Create Records”

There are three possible scenarios when using “Create Records” element in flow, ordered by the frequency of usage:

1. Create one, using separate resources

This is the most-used option by me. You type in the object to create, and then you can manually assign the values using either ad-hoc strings, or resources that you set up earlier in this flow.

flow create records - setup

By checking “Manually assign variables”, you can save the ID of the created record at a chosen variable.

Use CaseExplanation
You want the variable to have a neat name to reference it later.When the option is not chosen, the name of the auto-variable will be [ObjectId] From [API name of the Create Records element] (ex. AccountId From Create_New_Account). If you assign the variable yourself, then you can name it NewID for example, which is more readable.
You want to save this ID in an output-allowed variable.
The auto-created variable is not allowed for output. If you want to use this functionality, create a output-allowed variable and assign it manually.
What is input/output-allowed variable? See here!

flow create records - setup
Voila! Account created!
2. Create one, using all values from a record

If you have a variable storing all the values you need to create a record, you can also choose “Use all values from a record”.

flow create records - setup
Use CaseExplanation
You have used Get Records, and you want to clone that record directly or after some modification.When a Get Records element is used, a variable with the values from that record will be created. If you want to clone that record, simply use this instead of assigning the value field by field.
A record can easily be cloned by using this option!
3. Create multiple, using record collection

To create multiple records at once, you can only use a record collection variable, and save the required field values into each item in the collection.

What is a collection variable – see here!

flow create records - setup
Use CaseExplanation
Very rare. You might have a custom loop* in your flow which will generate several records and save them in a collection, then you create all the records at once .
The outcome is actually the same if you put the Create Records into the loop:

However this action will then be executed more times than just once. (If your loop runs 10 iterations, Create Records will run 10 times). This will slow down** the execution time of your flow. If you have a huge number of records to create, putting it outside of the loop will be a better option.
* Custom Loop: A loop that is not created through the Loop element. You can do this by creating a counter variable.
** Execution Time Comparison: I set the iteration as 5, the left flow used 480 ms, while the right used 610 ms.
Check Out How Create Records Can Be Used In Real Cases!
Use Case: Clone Any Objects with Related Lists with Flow
"Clone with related" is an amazing feature which sadly is ...
Read More
Use Case: Simple Loop Example in Flow
Earlier we have published the how-to-guides on Loop and Counter, ...
Read More
Use Case: Simple Counter Example in Flow
Earlier we have published the how-to guides on Loop and ...
Read More
Use Case: Clone Assets To Opportunity Products
I received this case to auto-create Opportunity Product or Quote ...
Read More
Use Case: Add Clone Button To Each Record In A Related List
If you migrated from Classic to Lightning, you must have ...
Read More
Use Case: Auto-Generate Multiple Lines Of Opportunity Product
* Updated at Mar. 25, 2021. The original flow is ...
Read More

Official Salesforce Help Article On Create Records

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments