Create the Get Products Action
Create a custom action that gets product records. The agent can filter information by products or product levels.
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 Apex.
- From the Reference Action Category dropdown, select Invocable Method.
- From the Reference Action dropdown, select Get Products.
-
Enter
Get Productsfor the Agent Action Label field andGet_Productsfor 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 product records based on the given filters and search parameters.
- In the Loading Text field, enter Searching Products.
-
Under Input, configure the following:
- For dateFrom:
- In the Instructions field, enter Timeframe Date From.
- Clear the Require Input checkbox.
- Select the Collect data from user checkbox.
- For dateThru:
- In the Instructions field, enter Timeframe Date Thru.
- Clear the Require Input checkbox.
- Select the Collect data from user checkbox.
- For productLevel:
- In the Instructions field, enter Product Level.
- Clear the Require Input checkbox.
- Select the Collect data from user checkbox.
- For searchString:
- In the Instructions field, enter Product Search String.
- Clear the Require Input checkbox.
- Select the Collect data from user checkbox.
- For parentProductId:
- In the Instructions field, enter Id of the parent product. Search will return records that have this product as one of its parents.
- Clear the Require Input checkbox.
- Select the Collect data from user checkbox.
- For dateFrom:
-
Under Output, for products:
- In the Instructions field, enter List of products matching the filters.
- Clear the Filter from Agent Action and Show in conversation checkboxes.
- From the Output Rendering dropdown, select Object.
- Click Finish.
Did this article solve your issue?
Let us know so we can improve!

