Create or Update Record action

  • Release version: Xanadu
  • Updated August 1, 2024
  • 2 minutes to read
  • Summarize
    Summarized using AI
    This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.

    Summary of Create or Update Record action

    The Create or Update Record action in ServiceNow allows you to efficiently create a new record or update an existing one within a specified table using a single operation. This action is especially valuable for automating workflows where records need to be maintained without duplication, by identifying existing records based on unique field values.

    Show full answer Show less

    Key Features

    • Identification of Existing Records: You select one or more fields as unique identifiers (e.g., short description and priority in an incident) to determine if a record already exists. If a matching record is found, it is updated; otherwise, a new record is created.
    • Handling Multiple Matches: If multiple records match the unique identifiers, the action does not update any record and reports an error to prevent unintended updates.
    • Input Configuration: You specify the target table and field values to create or update records. Dynamic values can be added via drag-and-drop from the Data panel or pill picker.
    • Unique Identifier Selection: The option to mark certain fields as unique identifiers appears once the table and fields are defined, guiding the action's create or update decision.
    • Limitations: The action does not support updating multiple journal fields such as additional comments or work notes in task records.
    • Roles and Access: Available in Workflow Studio as a core ServiceNow action. Users with the flowdesigner or admin role can configure and use this action within flows.

    Outputs

    • Record: Reference to the record created or updated, usable in subsequent flow steps.
    • Table: The name of the table where the operation occurred.
    • Status: Indicates the outcome as Created, Updated, or Error, visible in flow execution details.
    • Error Message: Provides details if the operation fails, assisting with troubleshooting.

    Practical Use for ServiceNow Customers

    This action enables customers to streamline data management by combining create and update operations, reducing complexity in flow design. By carefully selecting unique identifiers, customers ensure data integrity and avoid duplicate records. The clear output statuses and error messages support effective flow monitoring and error handling. Limitations around journal fields should be considered when designing workflows involving task notes or comments.

    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.

    Note:
    • 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.

    To learn about creating template value input, see Create a template value input.

    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.

    Update problem record from inbound email

    Figure 1. Inputs used for create or update problem record
    Inputs used for create or update problem record.