Solved

Dynamic product block using custom property Recommended products

  • 2 June 2022
  • 6 replies
  • 124 views

Badge

Hello!

 

I am trying to replicate what is described in the last section of the following Klaviyo article: https://help.klaviyo.com/hc/en-us/articles/360004785571-The-Catalog-Lookup-Feature (Lookup an Item ID as a Custom Property).

The only difference is that I would like to loop the recommended products in a product block (like it’s usually done for Abandoned Cart flows), not in a HTML template.

 

I have tried to create a table block with dynamic rows, using the following Row Collection:

 

{% for item in person|lookup:'Recommended Products' %}{% catalog item %}

{{ catalog_item }}

{% endcatalog %}

{%endfor %}

 

...where “Recommended Products” is my custom property listing the recommended product ids.

 

When I try to save the first step, I get the following error message:

 

 

Do you know if it’s possible to build such dynamic table block based on lookup of Item IDs within a Custom Property?

 

If yes, do you know where I made a mistake?

 

Thanks a lot for your help!

Grégoire

 

icon

Best answer by Dov 2 June 2022, 15:50

View original

6 replies

Userlevel 7
Badge +55

Hi @Gregoire,

Thanks for sharing this question with us.

The row collection for a dynamic table block is looking for a piece of event data (a.k.a an event variable) from the event that triggers the flow. A catalog look-up tag won’t work in this section, and that’s the reason why you’re seeing an “invalid row collection variable” error. For more information on using event variables in flows, I recommend checking out our article here.

I hope that’s helpful.

 

Badge +1

Hi @Gregoire,

Thanks for sharing this question with us.

The row collection for a dynamic table block is looking for a piece of event data (a.k.a an event variable) from the event that triggers the flow. A catalog look-up tag won’t work in this section, and that’s the reason why you’re seeing an “invalid row collection variable” error. For more information on using event variables in flows, I recommend checking out our article here.

I hope that’s helpful.

 

So how could one use Custom Properties that have for example a list of Product IDs on a wishlist?

Right now we are using Shopify with an app that sends a variable to Klaviyo that lands under Custom Properties called ‘WishlistProductIDs’. What i got from reading the docs, and not from your answer is that we cant really do anything useful with this information?

Yes i know we can trigger a flow, but that is very limiting as we can only do it for one item. 

Any other way to work around this?

Userlevel 7
Badge +55

Hi @coljung,

Thanks for your reply.

Indeed, custom properties can be used in a variety of contexts in Klaviyo. For example using them to segment your audience, filter flows, and include dynamic content within emails. The various use-cases are touched upon here.

To speak to using custom properties for dynamic content, you can achieve this using person look-up tags. This is touched upon (with some examples) in our article Guide to Template Tags and Variable Syntax

So, for example, if you inserted {{ person|lookup:'WishlistProductIDs'|default:’’ }} into your Klaviyo email, this would display all of those Wishlist Product IDs for the intended recipient. The default portion of the person look-up tag is used to specify a default in case a variable doesn't have a value. In this case, if no wishlist product ID existed, it would just leave that number blank, though you can change the default portion to whatever you want, for example {{ person|lookup:'WishlistProductIDs'|default:’No points at this time’ }}

I hope that’s helpful.

Badge +1

Thanks.

Now while your response is useful, I still don’t see how it could help un my scenario.

I basically want to use those IDs to show the user their products.

For example, if WishlistProductIDs is available, and there are two products with Id 001 and 002, ideally the email would show the details for product 001 and 002.

Would that be possible in any way?

Because us telling our customers that their wishlist has item 0389289242 would not make any sense for them. It would have ideally a picture or at least the product’s title.

 

Any idea about this?

 

 

 

 

Userlevel 7
Badge +55

Hi @coljung,

Thanks for providing that context for us.

You can still use the same person look-up tags as I mention above. However, the app would need to send us the image URL as the custom property in order to populate the image of the item. Likewise, the item title and any other information about the item would also need to be contained in a custom property value for us to populate it using person look-up tags.

Alternatively, you may want to look into using the Track API (reference guide here) to send us a custom event including the Wishlist item information. From there, you could use a dynamic block (rather than custom properties) to pull in this information (image URL, item title, item price etc.) That would be an ideal way to manage this.

Thanks for being a community member.

Badge +1

Hi @coljung,

Thanks for providing that context for us.

You can still use the same person look-up tags as I mention above. However, the app would need to send us the image URL as the custom property in order to populate the image of the item. Likewise, the item title and any other information about the item would also need to be contained in a custom property value for us to populate it using person look-up tags.

Alternatively, you may want to look into using the Track API (reference guide here) to send us a custom event including the Wishlist item information. From there, you could use a dynamic block (rather than custom properties) to pull in this information (image URL, item title, item price etc.) That would be an ideal way to manage this.

Thanks for being a community member.

Hey!

Actually someone from support shared a possible way to make it work and it does:

 

{% for item in person|lookup:'WishlistProductIDs' %}

{% catalog item %}

{ catalog_item.featured_image.thumbnail.src }}
{{ catalog_item.title }
{{catalog_item.url}}

{% endcatalog %}
{% endfor %}

 

Reply