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
You might have a 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 never do this because you might hit the governor limit! (If your loop runs 10 iterations, Create Records will run 10 times).
Check Out How Create Records Can Be Used In Real Cases!
Use Case: Create Parent and Child Cases in One Flow
Do you need to create a Screen flow that allows ...
Read More
Use Case: Replace “New” Button with Screen Flow
Currently we can only overwrite the New button using programmatic ...
Read More
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 Counter Example in Flow
Earlier we have published the how-to guides on Loop and ...
Read More

Official Salesforce Help Article On Create Records

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments