Map and Transform Data step

  • Release version: Australia
  • Updated July 23, 2026
  • 3 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 Map and Transform Data step

    The Map and Transform Data step enables ServiceNow customers to map complex nested JSON objects to a target schema with dynamic field creation and data transformation. It is available as a core action within Workflow Studio, allowing users to define mappings between source data and a structured output format. This capability helps automate data transformation tasks within flows, simplifying the integration and processing of hierarchical JSON data.

    Show full answer Show less

    Key Features

    • Role-based access: Users with flowdesigner or admin roles can configure the step. AI-assisted auto-mapping requires the sndmconnected.automapuser role, assigned both to users and the system user ihimport for ML engine functionality.
    • Flexible input handling: Accepts nested JSON objects as source data, supporting multiple nested levels and arrays. Users define a target data structure with customizable fields and root labels to organize output.
    • Dynamic field creation and scripting: Allows adding target fields dynamically and applying JavaScript-based custom transformations on source data via scripted fields for advanced data manipulation.
    • AI-assisted auto-mapping: Automatically suggests field mappings by analyzing source and target schemas, leveraging field names, data types, and patterns to reduce manual configuration effort. The auto-mapping feature runs securely under an elevated context.
    • Bulk mapping management: Provides options to clear all or only unmapped target fields with confirmation dialogs to prevent accidental data loss.

    Inputs and Outputs

    • Inputs:
      • Source Data: Nested JSON object to map.
      • Target: Defines the output object label and fields for mapping.
      • Script Field (optional): JavaScript code for custom data transformations.
    • Outputs:
      • Target Object: Transformed JSON object with mapped and scripted fields, named according to the target root label.
      • Step Status: Execution details including success or failure and error messages.

    Practical Use Case

    For example, when receiving nested user data, you can configure the step to flatten and combine fields (like name and age) into a simplified structure under a root label (e.g., "Root"). The output object then contains combined and individually mapped fields ready for downstream processing such as creating or updating user records. This approach streamlines data transformation and integration within ServiceNow flows.

    Map complex nested JSON objects to a target schema with dynamic field creation and data transformation.

    Roles and availability

    Available as a Workflow Studio core action. Users with the flow_designer or admin role can add an action to a flow and define configuration details. For AI-assisted field mapping with the Data Mapper component, users require the sn_dm_connected.automap_user role to access auto-mapping capabilities in a flow.

    For the auto-mapping ML engine to function, the system user ih_import (used by Integration Hub for API calls) must also be granted the sn_dm_connected.automap_user role. This is typically configured automatically during feature activation. If auto-mapping is not functioning, verify that the ih_import user has this role assigned in your system.

    Inputs

    Provide a value for each input that your flow needs. To add dynamic values, you can drag pills from the Data panel or select them from the pill picker.

    Field Description
    Source Data Data type: JSON Object. The nested JSON object to map and transform. Drag-and-drop a JSON data pill or use the data pill picker to select the source object. The source can include multiple levels of nested objects and arrays.
    Target Data type: Object. The output structure for the transformed data. Select Add field to display options to create a target field and configure its mapping. The root label of the target defines the name of the output object. For example, to map a nested person object to user fields, set the root label to "user" and add fields for each element. You can map multiple source fields to a single target field to combine or transform data.
    Script Field Data type: Script Objects. Optional custom transformations using JavaScript. Select Add scripted field to create a script object, define its name, select which source fields it uses, and write JavaScript code to perform transformations on those fields.

    Using auto-mapping

    When using the Data Mapper component within a flow, you can leverage AI-assisted auto-mapping to automatically suggest field mappings based on source and target schemas. Auto-mapping analyzes field names, types, and data patterns to recommend intelligent mappings, reducing manual configuration time. The auto-mapping feature runs under an elevated execution context to verify secure access to required resources.

    Running auto-mapping

    Click the Automap button (marked with a sparkle icon) to generate field mapping suggestions. The button is enabled only when both source and target fields are present.

    You can choose to auto-map:

    • All matching fields in the target table: Auto-map every field based on source field analysis
    • All unmapped fields in the target selection: Auto-map only target fields that don't currently have mappings

    Clearing mappings

    You can remove mappings in bulk using options in the target section overflow menu:

    • Clear all fields: Removes every mapping from the target table. Use this to start fresh with a clean slate.
    • Clear unmapped fields: Removes only the fields that don't currently have mappings. Use this for cleanup after accepting some suggestions and rejecting others.

    A confirmation dialog appears before executing any bulk clear operation to prevent accidental data loss. Review the dialog carefully before confirming.

    Outputs

    These outputs appear in the Data panel. You can use them as inputs elsewhere in your flow.

    Field Description
    Target Object Data type: Object. The transformed JSON object containing all mapped target fields with values from the source data and scripted field transformations. The object is named based on the target root label you configured.
    Step Status Data type: Object. Status information about the step execution, including success or failure indicators and error messages if any errors occurred during the transformation.

    Example: Transform and flatten user data with field combinations

    Example Map and Transform Data step.

    In this example, a flow receives nested user data with a mix of simple and complex fields. The Map and Transform Data step transforms and combines source fields to create a simplified target structure.

    The source data is a user object with the following structure:

    • user (object)
    • name (string)
    • age (string)
    • email (object)
      • address (string)
      • type (string)

    The step configuration sets the target root label to "Root" and creates target fields that include field combinations:

    • name_age (combines name and age fields into a single target field)
    • test (also combines name and age fields for a different purpose)
    • name_name (maps the name field)
    • age (maps the age field)
    • email (nested object containing address and type fields)

    The mapped source fields column shows the data pills for each mapping. For example, the name_age field displays data pills showing both "name" and "age" selections. The transformation shows actual mapped values in real-time.

    After the action runs, the Root output object contains all transformed fields with values combined and mapped. The Step Status output provides execution details. The transformed user data is ready for use in subsequent actions such as creating or updating user records.