Create Data Context Mapping

Picture of Kalanithi Balasubramanian

Kalanithi Balasubramanian

Updated on December 16, 2024

Let’s set up your Data Context Mapping, which tells GPTfy what data you want to send to the AI and protects sensitive data.

Follow these simple steps, and you’ll be up and running quickly!

Step 1: Open Data Context Mapping Tab

  • Open GPTfy and go to the Cockpit. Below is an example of what that will look like.

  • Click Data Context Mapping.

  • Find and click the “NEW” button at the top right corner of the new screen.

Step 2: Start the New Data Context Mapping

  • A pop-up window will appear. Type in a descriptive Mapping Name. This usually will include the type of AI prompts for which the mapping is being created (see example below).

  •  Choose the Target Object from the dropdown list. Here, we chose Case. Hint: After clicking the dropdown arrow, instead of scrolling through the extensive list of objects, start typing the name of the object you want. The bottom of the list will move to whatever you typed.

  •  The Target Object Label will automatically fill in. Click “Save” to move on.

Advanced Settings

Advanced settings show a list of Active API Data Sources in a dropdown menu from which the user can select an API Data Source.

Step 3: Add Related Objects

  • Next, click the dropdown arrow next to an object in the “Context Mapping” section.
  • Select “Add Related Object” to include any child objects your AI needs to know about.
  • A pop-up window will open. Choose the related object from the list. (In the example below, we would like to include case comments and child objects of cases.)

Remember: Any changes made to the data context mapping apply to every prompt using it. It is a best practice to keep the mapping as generic as possible.

  • Additional fields will appear, displaying related object details. Most will auto-populate.

  • Changes available here, such as including a Where Clause, changing the default ordering of Descending (newest to oldest), or including a record limit, might (or might not) be better located in individual prompts that need those parameters.
  • Where Clause: This is where you can specify the filter criteria. For example Id = ‘0018d00000cRq6rAAC’. Only records that pass this filter will be sent to AI for processing.

  • Click on the Pencil icon to create the where clause by using Query Builder

  • Query Builder: This tool helps users generate a ‘where’ clause. It’s available on Level 2 and 3 objects, providing flexibility in defining the criteria for data selection.

 
  • Order By: Users can use the ‘order by’ clause to sort records by any field. There is a separate field named ‘Order by’ so the user can use any field to sort records.

  • Record Limit: This is the number of records to be considered for mapping. It allows you to limit the number of records the AI processes simultaneously.

  • Click “Save” to continue.

  • Repeat this section, and add related objects for any other child objects needed. You even can add a child object to a child object (in other words, a grandchild to the main object). Three deep (main, child, and grandchild objects) is the limit, though.
 

Step 4: Select Field mapping

Now, it’s time to tell the app which information to send to the AI and which needs extra security. In the data to be transferred, indicate any personally identifiable information (PII).

Once pinpointed, GPTfy will mask that data for you automatically.

  • Click the dropdown arrow next to an object in the “Extraction Mapping” section.
  • Select “Field Mappings”.
 

Carefully choose the fields you want to include in prompts using this mapping. For each field available, you will have the following information (see the image below for a visual guide):

The search box, located at the top, operates in real time. It scans the field label, api_name, and type for any occurrence of the entered keyword.

The search process is not case-sensitive and operates in “like” mode (%keyword%), meaning it will find matches of the keyword anywhere within the data.

For each field available, you will have the following information (see the image below for a visual guide):

  • Field: API name of the fields within the object.
  • Label: The user-friendly name you see.
  • Send to AI: Check this box to send the data to the AI.
  • Masking Scope: Protect privacy! For every field containing PII, click the Masking Scope dropdown arrow to select masking layers (see below for more details).
  • Masking Value: Specify replacement value for all PII data.
  • The masking scope, “Entire Value”, will mask an entire field. It is best used for fields with predetermined values (such as a contact name that already exists in relation to this object), rather than a text field. Select the masking value that seems most appropriate, such as PersonFull(n) (meaning a person’s full name). There is no wrong answer for the masking value.
  • The masking scope, “Specific Patterns”, is available for a long text field only. It will mask PII that has been identified as PII elsewhere (such as a person’s name). The masking value for Specific Patterns will auto-populate.
  • Click “Save.”

  • Repeat steps 1-4 in this Select Field Mapping section for all of your objects.

  • The Quick Save button allows a user to save the mapping and stay on the field mapping window, while the Save button saves and closes the window.

  • The “Add Related Fields” button is a feature integrated into the pop-up window within a data Context mapping when a field mapping is selected. Its primary function is to display related fields associated with the objects selected for field mapping. This functionality serves a significant purpose by allowing users to access fields from parent objects and system objects, such as the “user” object.

  • For example, when a user clicks on this button while mapping fields within the “account” object, it provides access to fields within the “user” object. This lets users retrieve details about the created user and the last modified user.
  • When this button is activated within a related object field mapping, like “task” within an “opportunity” mapping, it extends its utility to bring in records from the associated “account” object. 
  • By selecting the “Account Id,” users gain access to all the fields contained within the “account” object, which are then displayed in a dropdown menu.

Note: You can see how many of the available fields you selected for each object when you look back at the Context mapping screen.

Step 5: Activate the Data Context Mapping

This button validates the field mappings, where clause. Only when this Data Context mapping is activated can we see the mapping in the prompt creation window.

Key points to remember

  • Choose the data wisely: Select only the data the AI needs and mask any sensitive information.
  • Organize your objects: Clearly define your main object and any related ones.
  • Simplify: Keep your context mapping as generic as possible, to make it useful for all of the prompts calling on that data.

That’s it! You’ve successfully created a Data Context Mapping.

Bonus Feature

You can use the “Clone with Related” button to create copies of the mapping easily. This allows you to test new ideas before putting them into production.

Note: Pressing the “Clone with Related” button will take you right to the clone, which will look exactly like the original, except for a brief message letting you know you have successfully cloned the context mapping. It even will have the same name. Be sure to edit it immediately, and change the name so you’ll know you’re working on a new mapping.