Securely send the right Salesforce data to AI—while protecting what’s sensitive.
Follow these simple steps to configure Data Context Mapping. This tells GPTfy which Salesforce data to include in the payload while applying masking rules for privacy and compliance.
Step 1: Open Data Context Mapping Tab
- Go to GPTfy Cockpit in your Salesforce environment.
- Click the Data Context Mapping tab.
- Select the New button in the top-right corner.
Step 2: Start the New Data Context Mapping
A configuration window will appear:
- Mapping Name: Enter a clear, descriptive name. This should reflect the type of prompts the mapping supports (e.g., “Case Summarization”).
- Target Object: Choose the main Salesforce object (e.g., Case, Opportunity).
Tip: Start typing the object name to jump to it faster. - The Object Label auto-populates.
- Click Save to continue.
Advanced Settings
- Choose an Active API Data Source if applicable.
- Use this only if the data will be fetched via external API connections instead of directly from Salesforce.
Step 3: Add Related Objects
To give GPTfy a richer context:
- In the Context Mapping section, click the dropdown next to your main object.
- Select Add Related Object.
- In the popup, choose a related child object (e.g. Case Comments).
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.
Optional Filters (Per Related Object)
- Where Clause: Limit which records are sent to the AI.
- Example: Id = ‘0018d00000cRq6rAAC’
- Use the Pencil Icon to create filters visually.
- Order By: Choose a field to sort records (default is newest first).
- Record Limit: Restrict the number of records sent per object.
- 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: Set Up Field Mappings and Masking
Define what data to send—and what to protect.
- In the Content Mapping section, click the dropdown next to an object.
- Select Field Mappings.
For each field:
- Field: API name
- Label: Friendly name
- Send to AI: Check to include it in prompt data
- Masking Scope: Choose how to anonymize PII
- Entire Value: Mask the full field value
- Specific Patterns: Mask only identified PII patterns (for long text)
- Masking Value: Choose the placeholder (e.g., PersonFull(n))
Click Quick Save to save the options and keep the window open with the latest field displayed at the top. Use Save to record your changes and exit the window.
Add Related Fields
Use this to bring in fields from parent or system-level objects.
Example: While mapping Task, use the “Add Related Fields” button to access fields from the related Account or User (creator/last modifier).
Note: You can see how many of the available fields you selected for each object when you look back at the Context mapping screen. The add related fields functionality works for five levels up.
Step 5: Activate the Data Context Mapping
Click Activate to:
- Validate your mapping configuration
- Make it available for selection when building prompts
Note- Mapping won’t be usable in prompts until it’s activated.
Best Practices
- Send only what’s needed
Avoid overloading prompts with extra fields. Be intentional. - Mask all PII
Use masking to stay compliant with privacy standards like GDPR or HIPAA. - Keep it Generic
Design mappings that work across multiple prompts and scenarios. - Review regularly
Update context mappings as your data model or prompt strategy evolves.
Bonus Feature
Use the Clone with Related button to quickly duplicate a mapping, including all related objects and fields which are included in the mapping.
This is great for:
- A/B testing different masking approaches
- Creating prompt-specific variations
Note: Remember to rename the cloned mapping to avoid confusion.