Create the Retrieve Promotions Measures Action
Create a custom action that gets all measures for promotions associated with a specific account. This action allows the agent to filter data based on products, product levels, and other criteria to answer user questions about promotion performance.
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 create custom agent actions for TPM Agent: | View Setup and Configuration |
- From Setup, in the Quick Find box, enter Agentforce Assets, and then select Agentforce Assets.
- Click Actions, and then click New Agent Action.
-
Set the initial attributes:
Reference Action Type: FlowReference Action: CGCloud: Get Promotions Measures
-
Enter
Retrieve Promotions Measuresfor the Agent Action Label field andRetrieve_Promotions_Measuresfor the Agent Action API Name field. - In the Agent Action Instructions field, enter: Finds and retrieves the measure values for the promotions of the given account for the given products or product levels and filters.
- In the Loading Text field, enter Retrieving measures.
-
Configure the input variables.
-
AccountId -
- Instructions: Record Id of the Account to retrieve data for. Must be a user selected account from the list of managed accounts.
- Select the Require Input checkbox.
- Clear the Collect data from user checkbox.
-
DateFrom -
- Instructions: Start of the timeframe for the requested data.
- Select the Require Input checkbox.
- Clear the Collect data from user checkbox.
-
DateThru -
- Instructions: End of the timeframe for the requested data.
- Select the Require Input checkbox.
- Clear the Collect data from user checkbox.
-
MeasureNames -
- Instructions: Requested Measures. The value for each of the measures of this parameter will be returned in the response. Only measures returned from the available measures list are supported.
- Select the Require Input checkbox.
- Clear the Collect data from user checkbox.
-
ProductIds -
- Instructions: The collection of product IDs used to get the associated measures. In the absence of any input, measures for the Total product level are returned.
- Select the Require Input checkbox.
- Clear the Collect data from user checkbox.
-
PromotionPhases -
- Instructions: List of promotion Phases to filter data. If not provided, all will be considered.
- Clear the Require Input checkbox.
- Clear the Collect data from user checkbox.
-
PromotionTemplateIds -
- Instructions: List of promotion templates to filter data. Promotion records will be filtered according to the provided templates. If not provided, all will be considered.
- Clear the Require Input checkbox.
- Clear the Collect data from user checkbox.
-
PromotionTimeframe -
- Instructions: Promotion timeframe. Promotion records will be filtered according to the provided timeframe. Only allowed values are "starting", "overlapping" or "including".
- Clear the Require Input checkbox.
- Clear the Collect data from user checkbox.
-
OrderBy -
- Instructions: Sets the ordering of the Promotion entries for each measure. Allowed values are "ASC" and "DESC". By default no ordering is applied.
- Clear the Require Input checkbox.
- Clear the Collect data from user checkbox.
-
-
Configure the output variables.
-
AccountId -
- Instructions: Id of the account the measures reference
- Clear the Filter from Agent Action and Show in conversation checkboxes.
- Output Rendering: Text
-
DateFrom -
- Instructions: Timeframe Start
- Clear the Filter from Agent Action and Show in conversation checkboxes.
- Output Rendering: Date
-
DateThru -
- Instructions: Timeframe End
- Clear the Filter from Agent Action and Show in conversation checkboxes.
- Output Rendering: Date
-
MeasureNames -
- Instructions: Measures retrieved on the request.
- Clear the Filter from Agent Action and Show in conversation checkboxes.
- Output Rendering: Text
-
OrderBy -
- Instructions: Result Ordering.
- Clear the Filter from Agent Action and Show in conversation checkboxes.
- Output Rendering: Text
-
ProductIds -
- Instructions: Product Ids requested
- Clear the Filter from Agent Action and Show in conversation checkboxes.
- Output Rendering: Text
-
PromotionPhases -
- Instructions: Promotion Phases used to filter
- Clear the Filter from Agent Action and Show in conversation checkboxes.
- Output Rendering: Text
-
PromotionTemplateIds -
- Instructions: Promotion Templates used to filter
- Clear the Filter from Agent Action and Show in conversation checkboxes.
- Output Rendering: Text
-
PromotionTimeframe -
- Instructions: Timeframe used to filter
- Clear the Filter from Agent Action and Show in conversation checkboxes.
- Output Rendering: Text
-
ResultMeasures -
- Instructions: Retrieved measures for the filters. This response will contain up to 5000 data points. If this limit is exceeded a message will be set to inform. Measure data is returned on a tree like structure with root level being the Product for which the measures are for, next level is the measure name, and the third level is the promotion record having the measure value
- Clear the Filter from Agent Action checkbox.
- Select the Show in conversation checkbox.
- Output Rendering: Rich Text
-
- Click Finish.
Did this article solve your issue?
Let us know so we can improve!

