Create the Retrieve Account Measures Action
Create a custom action that and gets account measures. The agent can then answer questions about account performance. It can filter data based on business year and products.
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.
- Click New Agent Action.
- From the Reference Action Type dropdown, select Flow.
- From the Reference Action dropdown, select CGCloud: Get Account Measures.
-
Enter
Retrieve Account Measuresfor the Agent Action Label field andRetrieve_Account_Measuresfor the Agent Action API Name field. - Click Next.
-
Configure the action's instructions and variables:
- In the Agent Action Instructions field, enter Finds and retrieves the request Account related measures for the given filters and products or product levels.
- In the Loading Text field, enter Retrieving measures.
-
Under Input, configure the following:
- For AccountId:
- In the Instructions field, enter 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.
- For BusinessYear:
- In the Instructions field, enter The business year for which the measure details for accounts and products are requested.
- Select the Require Input checkbox.
- Clear the Collect data from user checkbox.
- For IncludeMonthlyValues:
- In the Instructions field, enter When true, monthly data is returned as part of the response.
- Clear the Require Input and Collect data from user checkboxes.
- For MeasureNames:
- In the Instructions field, enter 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.
- For ProductIds:
- In the Instructions field, enter 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.
- For AccountId:
-
Under Output, configure the following:
- For AccountId:
- In the Instructions field, enter Id of the account the measures have been retrieved.
- Clear the Filter from Agent Action and Show in conversation checkboxes.
- From the Output Rendering dropdown, select Text.
- For BusinessYear:
- In the Instructions field, enter Business year the measures are for.
- Clear the Filter from Agent Action and Show in conversation checkboxes.
- From the Output Rendering dropdown, select Decimal.
- For IncludeMonthlyValues:
- In the Instructions field, enter If monthly values were requested.
- Clear the Filter from Agent Action and Show in conversation checkboxes.
- From the Output Rendering dropdown, select Boolean.
- For MeasureNames:
- In the Instructions field, enter Measures requested.
- Clear the Filter from Agent Action and Show in conversation checkboxes.
- From the Output Rendering dropdown, select Text.
- For ProductIds:
- In the Instructions field, enter Products requested.
- Clear the Filter from Agent Action and Show in conversation checkboxes.
- From the Output Rendering dropdown, select Text.
- For ResultMeasures:
- In the Instructions field, enter 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 time period for the measure value (total, month or year).
- Clear the Filter from Agent Action checkbox.
- Select the Show in conversation checkbox.
- From the Output Rendering dropdown, select Rich Text.
- For AccountId:
- Click Finish.
Did this article solve your issue?
Let us know so we can improve!

