Create or Update Record action
Summarize
Summary of Create or Update Record action
The Create or Update Record action in ServiceNow enables you to either create a new record or update an existing record within a single operation on a specified table. It is designed to simplify record management by using selected fields as unique identifiers to determine whether to update an existing record or create a new one. This action is available in Workflow Studio for users with theflowdesigneroradminroles.
Show less
How It Works
The action identifies existing records by matching values in fields you specify as unique identifiers. For example, if you mark short description and priority as unique identifiers for the Incident table, the action will update the incident that matches these values instead of creating a new one. If no unique identifiers are selected, the action always creates a new record. If multiple records match the unique identifiers, the action does not update any record and returns an error.
Inputs
- Table: Specifies the target table where the record will be created or updated.
- Fields: Defines field values to set or update on the record. Dynamic values can be provided using pills from the Data panel. Note that journal fields such as additional comments or work notes cannot be updated using this action.
- Determines uniqueness: A True/False option for each field to indicate if it should be used as a unique identifier to find existing records for update.
Outputs
- Record: Reference to the created or updated record for use elsewhere in the flow.
- Table: Name of the table where the record was created or updated.
- Status: Indicates action outcome with values: created, updated, or error.
- Error Message: Provides details if the action fails.
Important Considerations
- Updating multiple journal fields such as additional comments or work notes is not supported.
- Dynamic field values may trigger server-side validation rules but will not trigger UI policies.
- If more than one record matches the unique identifiers, the action fails and logs an error.
Create or update a record in a ServiceNow table using a single operation. Update a record that exists, or create a record using the values provided.
Identification of existing records
The Create or Update Record action identifies existing records by searching for matching values in the fields that you select as unique identifiers. For example, you can specify that the short description and priority fields uniquely identify an incident. When the action finds an incident with a matching short description and priority, it updates the matching record rather than creating a new record.
- If no field is selected as a unique identifier, the action creates a record with the field values provided.
- If more than one record matches the value of the unique identifiers, the action doesn't update any records and displays an error message in the flow execution details.
Roles and availability
Available as a Workflow Studio ServiceNow core action. Users with the flow_designer or admin role can add an action to a flow and define configuration details.
Inputs
Provide a value for each input that your flow needs. To add dynamic values, you can also drag and drop pills from the Data panel or select them from the pill picker.
- Table
- Data type: Table Name
Table in which to create or update a record.
- Fields
- Data type: Template Values
Field values to set or update for the record. For example, to set the short description to a certain value, select Short description and set the desired value.
Important:The system does not support updating multiple journal fields such as the additional comments or work notes of a task record.If adding the action to a subflow, you can Create a template value input. Dynamically set field values can trigger server-side validation rules but cannot trigger UI policies.
- Determines uniqueness
- Data type: True/False
Option for selecting the field as a unique identifier, which determines when to update or create a record. A record is updated when the incoming field value matches an existing record field value. A record is created when the incoming field value does not match an existing record field value. This option appears when the required table name and fields are selected.
Outputs
These outputs appear in the Data panel. You can use them as inputs elsewhere in your flow.
- Record
- Data type: Record
Reference to record created or updated.
- Table
- Data type: Table Name
Table where record was created or updated.
- Status
- Data type: Choice
Completion status of the action. The flow execution details page displays one of these values.
- Created [created]: The action created a record.
- Updated [updated]: The action updated a record.
- Error [error]: The action produced an error.
- Error Message
- Data type: String
Error message produced when the record operation fails.