Configure Agent Context Variables, Filters, and Mappings
To ensure the agent acts consistently, set up its context variables, filters, and map them to the appropriate actions within each topic.
Required Editions
Available in: Lightning Experience Available in: Agentforce 1, Einstein 1, Enterprise and Unlimited Editions with Consumer Goods Cloud Retail Execution and Agentforce for Consumer Goods Cloud add-on licenses |
| User Permissions Needed | |
|---|---|
| To configure agent context and filters | View Setup and Configuration |
In the Agentforce Builder interface, begin by selecting the agent you created.
- From Setup, in the Quick Find box, enter Agentforce Agents, and then select Agentforce Agents.
- Select TPM KAM Agent.
- Click Open in Builder.
-
Create the Agent Context Variables.
- In the Agentforce Builder, on the left sidebar, click Context.
-
For each variable in the following table, click New
Variable, fill in the properties, and click Save.
For all variables, select Allow value to be set by API and
Allow LLM to use value.
Name / API Name Data Type Description TPMContextAccountId Text Account Id to use on TPM Context TPMContextAccountReadAccess Boolean If true, user has read access to the current context account TPMContextAccountReadWriteAccess Boolean If true, user has read and write access to the current context account TPMSalesOrg Text Sales Organization value of the current user
-
Create the Agent Filters.
- Navigate to the Filters tab.
-
For each filter, click New, fill in the properties, and
click Save.
Filter Name / API Name Conditions TPMAccountHasReadAccess TPMContextAccountId Is Not Empty AND TPMContextAccountReadAccess Equals true TPMSalesOrgLoaded TPMSalesOrg Is Not Empty
-
Configure filters and mappings for the TPM Measures Account
topic.
- Click the topic name, then click the This Topic’s Actions tab.
-
For the Validate TPM Account action, map the outputs:
- Map the Output AccountId variable to TPMContextAccountId.
- Map the Output HasReadAccess variable to TPMContextAccountReadAccess.
- Map the Output HasReadWriteAccess variable to TPMContextAccountReadWriteAccess.
-
For the Retrieve Account Measures action, apply a filter and
map the input:
- Click the Filter icon and add the TPMAccountHasReadAccess filter.
- Map the Input AccountId variable to TPMContextAccountId.
-
Configure filters and mappings for the TPM Measures Promotion
topic.
- Click the topic name, then click the This Topic’s Actions tab.
-
For the Read User Sales Organization action, map the
output:
- Map the Output SalesOrg variable to TPMSalesOrg.
-
For the QueryRecords action, apply a filter:
- Click the Filter icon and add the TPMSalesOrgLoaded filter.
-
Configure filters and mappings for the TPM Measures Promotions
topic.
- Click the topic name, then click the This Topic’s Actions tab.
-
For the Validate TPM Account action, map the outputs:
- Map the Output AccountId variable to TPMContextAccountId.
- Map the Output HasReadAccess variable to TPMContextAccountReadAccess.
- Map the Output HasReadWriteAccess variable to TPMContextAccountReadWriteAccess.
-
For the Read User Sales Organization action, map the
output:
- Map the Output SalesOrg variable to TPMSalesOrg.
-
For the Retrieve Promotions Measures action, apply a filter
and map the input:
- Click the Filter icon and add the TPMAccountHasReadAccess filter.
- Map the Input AccountId variable to TPMContextAccountId.
- For the QueryRecords action, apply the TPMSalesOrgLoaded filter.
-
Configure filters for the TPM BOAPI Promotion topic.
- Click the topic name, then click the This Topic’s Actions tab.
- For the Read User Sales Organization action, map the SalesOrg output to TPMSalesOrg.
- For the QueryRecords action, apply the TPMSalesOrgLoaded filter.
Did this article solve your issue?
Let us know so we can improve!

