Configure the Context Engine Mapper

  • Release version: Australia
  • Updated March 12, 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 Configure the Context Engine Mapper

    The Context Engine Mapper in ServiceNow is a framework used to define mappings between source entities and context entities. It helps categorize and organize data collected by the Data Context Engine by associating data sources with specific records in a context table. This mapping enables context-specific data resolution, such as linking customer engagements to accounts, facilitating meaningful analysis based on breakdown fields like account type or engagement status.

    Show full answer Show less

    Key Features

    • Mapping Types:
      • Global (Related Table): Matches values from a source table field against a query field in a related table to retrieve mapped context records.
      • Metric Based: Allows granular, condition-specific mappings that depend on the data source used for metrics, enabling flexible and advanced filtering.
      • Script-based: Overrides table-based mapping, allowing custom logic to resolve context records when dot-walking is insufficient.
    • Configurable Parameters:
      • Source Table and Field: Define the origin of data to be mapped.
      • Supporting Related Table and Query Field: Establish the link between source and context tables.
      • Resolving Context Table and Field: Specify where mapped context data is stored.
      • Optional Resolving Table Conditions: Apply additional filters to refine context resolution.
      • Metric List: For metric-based mappings, select applicable data sources that take precedence over global mappings.
      • Script: Custom scripts can be defined to return context record IDs when standard queries are insufficient.

    Practical Application for ServiceNow Customers

    To configure the Context Engine Mapper:

    • Log in with a user assigned the snacctlc.customersuccessagent role.
    • Navigate to All > Data Context Engine > Context Engine Mappers and create a new mapping.
    • Enter the required details such as type, source table and field, related table and query field, and resolving context details.
    • Optionally define scripts or conditions for complex scenarios.
    • Save the mapper and publish the associated data source to start collecting and organizing data accordingly.

    This process enables customers to ensure that data collected through the Data Context Engine is accurately categorized and linked to relevant context records, improving data analysis and operational insights.

    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.

      Metric data collection data source
    6. Open the data source you had created earlier and select Publish.

      Data will now be collected according to the defined 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