You are here:
Create Records Element
Create or update multiple Salesforce records by using a record collection variable. Create or update exactly one Salesforce record by using a record variable or other values from the flow.
Required Editions
| View supported editions. |
How many records you choose to create or update and how to set the field values determine what to enter in the rest of the Create Records element.
This video explains how to use data elements to create, update, and delete records using a flow.
View this video in a separate tab.
To create a collection of records
To create multiple records, you must use the values from a record collection variable. Earlier in the flow, populate the record collection variable with the new records’ field values. Make sure the ID field is blank.
To dynamically create some records and update others in a collection, enable Update Existing Records. Choose a field on the records in the record collection variable that uniquely identifies each record. The flow uses this field to check whether the records exist. Choose how to process the remaining records if the flow fails to create or update a record.
When you use a record collection variable to create or update multiple records at once, you reduce the number of DML requests in your flow. That means you’re more likely to stay within your org’s limits. For more information, see Flow Bulkification in Transactions.
To create a single record
If you’ve populated a record variable with the field values for the new record, choose to set the record fields by using all the values from a record variable. Then select the record variable to use. Make sure the ID field is blank.
To dynamically create or update a record, enable Update Existing Records. Choose a field on the record in the record variable that uniquely identifies the record. The flow uses this field to check whether the record exists.
To manually map values from various resources in the flow, choose to set the record fields by using separate variables, resources, and literal values. Choose the object that you want to create a record for, and set the field values for the record. Optionally, store the ID of the created record in a Text variable if you manually created the variable. For example, when you need the record’s ID to create child records or to provide a link to the created record.
To dynamically check for a duplicate record to update or create, enable Check for Matching Records.
Usage
To prevent the flow from failing, make sure that:
- All required fields are populated with values. The Create Records element populates potentially required fields for you. The fields shown are required in the master record type. For custom objects, confirm the required fields in the object definition.
- For record variables the ID field values are blank. The flow populates the ID fields after the record is created.
Considerations
- If a Create Records element uses a record collection, doesn’t have a fault path, and the flow fails, no records are created, and the flow stops, generating an error.
- If a Create Records element uses a record collection and has a fault path, only the successful records are created. The IDs of the successful records aren’t populated for the records in the record collection in the flow. The IDs are populated on the records in the org.
- The Create Records element can’t update matching records that are locked for editing. If Flow Builder finds a matching record and attempts to update a field in the record, a warning appears.
- The Create Records element can’t update read-only fields in matching records. If Flow Builder finds a matching record and attempts to update a field that's always read only or that you don’t have permission to update, a warning appears.
- The Create Records element can’t update fields in matching records for objects that don’t support the update function. If Flow Builder finds a matching record and attempts to update a field in an object that doesn’t support the update function, an error appears, and you can’t activate the flow. To determine whether an object can be updated, see Object Reference for the Salesforce Platform.
- Check for Duplicate Records
To prevent duplicate records, check for records that match a set of criteria and specify what happens if the flow finds matching records. Some field-level configurations and validations in your org override the settings in the Create Records element.

