Configure the Context Engine Mapper

  • Release version: Zurich
  • Updated July 31, 2025
  • 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 Configure the Context Engine Mapper

    The Context Engine Mapper in ServiceNow enables you to define mappings between source entities and their corresponding context entities. This framework helps resolve context-specific records from given data sources, such as linking customer accounts to engagements. It ensures data collected by the Data Context Engine is categorized and organized based on designated breakdown fields (e.g., account type, engagement status, sold products), facilitating meaningful analysis.

    Show full answer Show less

    Key Features

    • Mapping Types:
      • Global (Related Table): Matches source field values with query fields in a related table to return mapped context records.
      • Metric Based: Allows more granular, condition-specific mappings based on the data source used for metrics and measurements, enabling enhanced filtering.
      • Script-Based: Overrides table-based mapping by using custom scripts to resolve context records when dot-walking is not possible.
    • Configurable Fields: You specify source tables and fields, supporting related tables and query fields, along with resolving context tables and fields where mapped data is stored.
    • Resolving Table Conditions: Optional filters can be applied to narrow down context records based on specific criteria.

    How to Configure

    1. Log in as a user with the snacctlc.customersuccessagent role.
    2. Navigate to All > Data Context Engine > Context Engine Mappers and create a new mapper.
    3. Choose the mapping Type, select the source table and source field, and configure the supporting related table and query field for global mappings.
    4. For metric-based mappings, select the appropriate data source; these mappings override global ones if applicable.
    5. Set the resolving context table and field where mapped data will be stored.
    6. Optionally, define resolving table conditions or provide a script to customize the mapping logic.
    7. Submit the configuration to save the context mapper.
    8. Publish the corresponding data source to start collecting data based on the defined schedule, populating the Context Engine Data table.

    Practical Benefits for ServiceNow Customers

    By configuring the Context Engine Mapper, customers can accurately categorize and relate data from various sources to relevant context records, improving data organization and insight generation. It supports complex and flexible mapping scenarios, including script-based customizations, ensuring adaptability to diverse business needs. This setup ultimately enables better data-driven decisions and efficient management of customer success operations.

    After you have defined the data source, use the Context Engine Mapper to specify the record in the context table for which it is applicable.

    The Context Engine Mapper is a framework that establishes mappings between source entities and their corresponding context entities. It enables the resolution of context-specific records based on given sources, such as resolving engagements from customer accounts.

    You can use the Context Engine Mapper to determine which fields will be used to categorize data collected by the Data Context Engine. This mapping ensures that data is organized and analyzed based on designated breakdown fields such as account type, engagement status, or sold products.

    Note:
    You can set up the context engine to map the source and target tables using one of the following methods:
    • Related table: Use the mapping rule related table[query_field] = source table[source_field]. In every record in the Source table, the Source field value is matched with the Query field in the Related table.
    • Script: If a script is defined, it takes precedence over the table based mapping. The script checks the Source Field and the ID of the record to determine the appropriate context based on the resolving context table.
    • Metric based: Mapping logic can vary depending on the data source used for metrics and measurements. Can be used for more granular and context specific mappings.
    1. Login as a user with the sn_acct_lc.customer_success_agent role.
    2. Navigate to All > Data Context Engine > Context Engine Mappers > Create New.
    3. Enter the following details:
      Field Description
      Type This can be:
      • Global: For each record in the source table, the source field value is matched against the query field in the supporting related table. If a match is found, the associated values from the resolving context field are returned as mapped context records.
      • Metric based: This type is used to enable mapping specific to certain data sources or conditions. The mapping logic can vary depending on the data source used and provides enhanced filtering and flexibility.
      Source table Select the source table to which the data source is to be mapped. This table is related to the attribute selected in the Breakdown field in the Data Source table. For example, if you selected Account in the Breakdown field, select the Customer Account table here.
      Source field The specific field in the source table that contains the data to be mapped.
      Supporting related table The related table that will be used to connect the source and context tables.
      Query field Select the field that is used to query or dot walk the Supporting related table to map data from the Source table to the Context table.
      Metric list If Type is Metric based, select a data source from the list. If a data source listed here is used for a specific source or target table, this mapping takes precedence over the Global mapping.
      Resolving context table The target table where resolved context records are stored.
      Resolving context field The target field where the mapped data will be stored.
      Resolving table conditions (Optional) You can use additional conditions, such as field level filters, to narrow down the results from the resolving context table based on specific criteria.
      Script If you cannot query the context table through dot walking, you can define a script that uses the Source field and returns an array of possible context fields.
      Note:
      If a script is defined for a Metric based mapper, it overrides:
      • Supporting related table
      • Resolving table conditions

      The script returns an array of context record IDs based on the conditions defined.

    4. Select Submit to save the context mapping.
    5. Navigate to All > Data Context Engine > Data Sources.
    6. Open the data source you had created earlier and select Publish.

      Data will now be collected based on the predefined schedule and the context engine data record is created and stored in the Context Engine Data table.

    The following examples show how to set up the different types of mapping:

    Related table (Global)

    Context engine mapping with related table
    Metric Based Type
    Metric based mapping
    Script

    Context engine mapping with script