Skip to main content

Create Records (Advanced)

Overview

This action allows records to be created while also setting advanced DML Options.

This action respects user permissions for Field Level Security and Object Level Security.

info

This action should only be used if the advanced functionality of setting DML Options is required, such as running assignment rules or allowing Field Truncation. Otherwise, it is recommended to use the standard Create Record action in Flows.

Inputs

Record

A single record that will be created and inserted into the database.

Type
Record

Records

A collection of records that will be created and inserted into the database.

Type
Record Collection

Allow Field Truncation

Setting this value to true allows field values that are too long to be trimmed upon insert instead of failing.

Type
Boolean

Allow Duplicates

Setting this value to true bypasses Duplicate Rules and allows duplicate records to be created.

Type
Boolean

Run Default Assignment Rule

Setting this value to true runs the default assignment rules for the created object.

Type
Boolean

Assignment Rule to Run

Specify what Assignment Rule to run. Query this record in a previous step of the Flow to use here.

Type
Assignment Rule Record

Send Auto Response Emails

Setting this value to true triggers auto-response rules for leads and cases. This email can be automatically triggered by creating, editing, or deleting a contact for a case.

Type
Boolean

Send User Emails

Setting this value to true triggers email that is sent to users in the organization. This email can be automatically triggered by a number of events; resetting a password, creating a new user, or creating or modifying a task.

Type
Boolean

Send Other Emails

Setting this value to true triggers email that is sent to users in the organization. This email can be automatically triggered by creating, editing, or deleting a contact for a case.

Type
Boolean

Locale

Specifies the language of any labels that are returned. The value must be a valid user locale (language and country), such as de_DE or en_GB.

Type
Boolean

External ID Lookup Field Mappings

Set field mappings that enable lookup fields to be automatically set based on External ID fields in related objects. The format is a CSV of Lookup API Field Name:Related Object External ID API Field Name.

For example, let's say there is an Account record with an External_ID__c field containing a value of NS-1234. If you are inserting Contact records you can set the AccountId field to NS-1234 on the Contact and pass in the following value to this configuration input.

AccountId:External_ID__c

Upon record creation, the AccountId lookup field on the Contact will automatically point to the Account with the value of NS-1234 in the External_ID__c field.

Type
Text

Validate Only

This will perform a test insert and no records will be saved to the database. This will also set the Save Results output variable that can be used to determine why the creation of records failed. This is useful if you would like to show a message to users why the records have failed before attempting the insert.

Type
Boolean

Outputs

Record

The single record after creation. The ID field is available on this record.

TypeVariable Name
Recordrecord

Records

The record collection after creation. The ID field is available on these records.

TypeVariable Name
Record Collectionrecords

Successful

Set to true if the create record action was successful.

This value is only set to false when the input variable Validate Only is set to true. If Validate Only is set to null or false and the create record action fails an exception will be returned that can be handled with a flow Fault Path.

TypeVariable Name
Booleansuccessful

Error Message

If Validate Only is set to true and the create record action fails this value will contain the error message.

TypeVariable Name
TexterrorMessage

Save Results

If Validate Only is set to true this output variable will contain detailed information for each record creation for successes and failures.

TypeVariable Name
Save Result (Collection)saveResults

Apex-Defined Types

SaveResult

This custom data type provides detailed information on the successes and failures for records when Validate Only is set to true.

NameTypeDescription
recordRecordThe record that was inserted or validated.
successBooleanBoolean that indicates if if record was created successfully or passed validation.
errorsError (Collection)A collection of Error records with details on record creation failure or validation failure.
objectNameTextThe API Name of the created records

SaveResult.Error

This custom data type provides detailed information on the successes and failures for records when Validate Only is set to true.

NameTypeDescription
messageRecordThe error message text.
statusCodeBooleanThe error status code.
fieldNamesText (Collection)A collection of field names that identifies which fields in the object, if any, affected the error condition.