Find Products Action
Search for the products from a catalog, category, or subcategory by using the specified search term.
This action is available in API version 62.0 and later.
The Find Products action is available in Enterprise, Unlimited, and Developer Editions where Product Discovery is enabled.
You can invoke this action via Apex and Flows only.
| Input | Type | Description |
|---|---|---|
additionalContextData | Apex-defined | An array of Apex runtime_industries_cpq.AdditionalContextData records that contain the additional nodes that are used along with the context definition nodes for data hydration. The maximum number of supported nodes is 10. |
additionalFields | Apex-defined | An Apex runtime_industries_cpq.AdditionalFields record that contains an array of additional standard or custom fields to include in the response. The supported objects are Product2 or ProductAttributeDefinition—If the fields defined for the ProductAttributeDefinition object aren’t available for the ProductClassificationAttr object, then the API request fails. |
catalogId | string | Catalog ID that’s used to find and retrieve the products. |
categoryId | string | ID of the category or subcategory to get the products for. |
contextDefinition | string | API name of the context definition used for context creation. If you don’t specify a value, the context selected on the Product Discovery Settings page from Setup is used. |
contextMapping | string | API name of the context mapping that’s used for data hydration. The value of this parameter is used only if it belongs to the specified context definition. |
correlationId | string | Currency code that’s used to calculate and show prices. Only the products with the currency code matching the specified currency code are fetched. |
currencyCode | string | Currency code that’s used to calculate and show prices. |
cursor | string | A unique identifier that represents the position of the product from which the next set of results are retrieved. |
executeConfigurationRules | boolean | Indicates whether configuration rules must run (true) or not (false). Available in API version 67.0 and later. |
enablePricing | boolean | Indicates whether the pricing procedure must run (true) or not (false). The default value is true. To use this parameter, you must enable the Pricing Procedure setting from Setup. |
enableQualification | boolean | Indicates whether the qualification procedure must run (true) or not (false). The default value is true. To use this parameter, you must enable the Qualification Procedure setting from Setup. |
filter | Apex-defined | A collection of Apex runtime_industries_cpq.FilterInputRepresentation records where each record contains a related object and the filter criteria that’s applied on the object. The filter parameter supports only the name property. The supported operators are eq, in, or contains. If this parameter contains multiple criteria, all the criteria are applied. |
includeCatalogDetails | boolean | Indicates whether catalog details must be included in the response (true) or not (false). |
limit | integer | Maximum number of results to be returned in the response. Enter a value from 1 through 100. The default value is 10. |
orderBy | string | Comma-separated string of key-value pairs that specify how results are sorted. Each string must contain a field name and its sort order. For example, ["name:asc",”custom_field:asc”]. |
priceBookId | string | ID of the pricebook from which you wan to retrieve the pricing details. |
productClassificationId | string | ID of the product classification that’s used to filter products. |
pricingProcedure | string | API name of the pricing procedure to calculate product prices. If you don’t specify a value, the pricing procedure selected on the Product Discovery Settings page from Setup is used. |
qualificationProcedure | string | API name of the qualification procedure to evaluate product eligibility. If you don’t specify a value, the qualification procedure selected on the Product Discovery Settings page from Setup is used. |
transactionContextId | string | Context ID of the quote or order. Available in API version 67.0 and later. |
transactionId | string | ID of the quote or order. Available in API version 67.0 and later. |
relatedObjectFilters | Apex-defined | A collection of Apex runtime_industries_cpq.RelatedObjectFilterInputRepresentation records, where each record contains a related object and the filter criteria that’s applied on the object. |
searchTerm | string | Required. Search term to find and retrieve products. |
userContext | Apex-defined | An Apex ConnectApi.UserContextInputRepresentation record that contains the user details to evaluate product eligibility and calculate prices. |
| Output | Type | Description |
|---|---|---|
apiStatus | Apex-defined | An Apex runtime_industries_cpq.ApiStatusRepresentation record that contains a status code and message. |
contextId | string | ID of the context that’s created by using the specified context definition. |
correlationId | string | ID to reference a series of related actions. |
cursor | string | Unique identifier that represents the position of the next product in the dataset. It’s used as an input to retrieve the next set of products. |
facets | Apex-defined | Collection of Apex ProductFacetsRepresentation records that contain details of the facet that’s retrieved. |
results | Apex-defined | An Apex runtime_industries_cpq.SearchProductsRepresentation record that contains the products that match the query. |
userContext | Apex-defined | An Apex ConnectApi.UserContextRepresentation record that includes the user details. |
Here’s a sample input to call this invocable action from Apex code.
Here’s a sample response for this action.
To use an Apex-defined input parameter in a flow, follow these guidelines.
Create an Apex Class
Create an Apex class defining the input and output parameters. In the flow, include the Apex-defined input parameters for which you want to add the details. In this example, we’ve created a class named ProductServiceAction that takes an object’s API name and record ID as input, and returns the additional context data.
Create a Flow with the Necessary Variables and Components: Create a flow that enables users to add a search term to find products. Add the ProductService action that you’ve created above by using Apex. When a flow is invoked from a record, the flow sends the record’s objectApiName and recordId to the Apex class, which then generates the flow output. The flow passes the objectApiName and recordId of the record that the flow is invoked from to the Apex class to generate the flow output. See Example of How to Create a Flow for Product Discovery.
Configure the Action: Configure the action (for example, Find Products action) to add values for the Apex-defined input parameters. Use the output of the created Apex class as the input of the Apex-defined parameter in the Find Products action, which users can use to find products.