Fetch from Product Feed

findProduct Function

The #findProduct fetches a product from your Product Feed, by using an SKU. By itself, it's a limited function, but when used in conjunction with #includeProducts or #findMatching, it can be a powerful tool for customizing your messages.


Find a Product by its SKU

The first example shows how to use the #findProduct function to fetch the image link of a users' favourite Product, which has been attached to the User via the User Feed.

{{#findProduct user.[traits.favoriteProductSku]}}

Get the remaining Stock Count for products in the Cart

The second example shows how to use the #findProduct function together with #includeProducts to show the remaining stock for the three most expensive items in the cart.

{{#includeProducts '{
    "cartProducts": true,
    "options": {
        "maxResults": 3, 
        "sortBy": "properties.price", 
        "desc": true, 
        "distinct": true
 {{#findProduct [properties.sku]}}

#findProduct extension to search a list (also within another product)

On June 7, we've included an update to our #findProduct function that can enable you to go even further than before by pulling a specific element from a list (or even a list attached to another product). Here's what the list could look like in the product feed:

  mainProductSKU: 111111,  
  accessoriesSKUS: 998776, 776655, 223344, 778899

This works great with simple cross-selling cases, especially when you'd like your customer to buy accessories for an item or even other related items. Here's an example of how to search within another product:

{{#findProduct [properties.sku]}} <!-- this searches for the main product -->
    {{#findProduct [properties.accessoriesSKUS] itemFromList=0}} <!--this searches within the main product for the first item in the list-->

The above example will search the "mainProductSKU" (111111 in our example) and returns the details of the first accessory (itemFromList=0 in our example, which is 998776).

Last updated