Filter Details Field Reference

The filtering is performed based on Product object records. Attempting to filter out Order Line Item objects with an advanced filter may result in unexpected behavior.

The Filter Details field contains JSON with filter setting for the order cart. Each object in Filter Details array can have the following keys:


Field API name: FilterDetails


Key Required/Optional Type Description

condition

Optional

List of objects

List of additional conditions that are applied to the object key. See available keys in the table below.

defaultVisibility

Optional

Boolean

Specifies if the filter will be displayed when first opening filter options pop-up. Available values:

  • true (the filter will be displayed when first opening filter options pop-up)

  • false (default)

field

Required

String

API name of the field that will be searched for the filter value.

filterLabel

Required

String

Name of the filter that will be displayed in UI.

filterType

Required

Enum

Determines the way to handle filter value. Available values:

  • text

  • picklist (multiple choice picklist)

lookupPath

Optional

String

API name of the lookup field to the Product object from the object specified in the object key. If not specified, the package lookup to Product object is used, i.e orders__ProductId__c.

object

Optional

String

Object that will be used to search for the filter value. If not specified, the Product object is used as determined in Object Settings.

operator

Optional

Enum

Handling of additional conditions. Available values:

  • AND

  • OR

searchLogic

Required

Enum

Query format. Available values:

  • basic

  • advanced (filtration of line items that have no direct relation to the filtering criteria or when the filter includes custom objects)

The condition key can have the following keys:

Key Required/Optional Type Description

field

Required

String

Field that will be used in subquery.

operator

Required

Enum

Operator that will be used in subquery. Available values:

  • equal

  • notEqual

value

Required

String, number, boolean

Value that will be used in subquery. Lookup fields must be provided in the {!Order.fieldName} format.

Filter Details JSON example:

Click to view
[
   {
      "filterLabel":"External ID",
      "defaultVisibility":true,
      "filterType":"text",
      "searchLogic":"basic",
      "object":"CTCPG__Product__c",
      "lookupPath":"orders__ProductId__c",
      "field":"CTCPG__ExternalId__c"
   },
   {
      "filterLabel":"Family",
      "defaultVisibility":true,
      "filterType":"picklist",
      "searchLogic":"basic",
      "object":"CTCPG__Product__c",
      "lookupPath":"orders__ProductId__c",
      "field":"CTCPG__Family__c"
   },
   {
      "filterLabel":"Is in stock",
      "defaultVisibility":false,
      "filterType":"text",
      "SearchLogic":"advanced",
      "Object":"orders__StoreProduct__c",
      "LookupPath":"orders__ProductId__c",
      "Field":"orders__HasStock__c",
      "operator":"AND",
      "conditions":[
         {
            "field":"orders__AccountId__c",
            "operator":"equal",
            "value":"{!Order.orders__AccountId__c}"
         },
         {
            "field":"orders__isActive__c",
            "operator":"notEqual",
            "value":false
         }
      ]
   },
   {
      "filterLabel":"Selling Group",
      "filterType":"picklist",
      "searchLogic":"advanced",
      "object":"orders__SellingGroup__c",
      "lookupPath":"orders__ProductId__c",
      "field":"Name",
      "operator":"AND",
      "conditions":[
         {
            "field":"orders__AccountId__c",
            "operator":"equal",
            "value":"{!Order.orders__AccountId__c}"
         }
      ]
   }
]
``