Skip to main content
Solved

How to i filter an array on an event?

  • 13 July 2024
  • 1 reply
  • 34 views

How does one filter an array in klaviyo? 

I would like to something like this - {{ event.extra.note_attributes.filter(a => a.name === 'shopflo_checkout_url')'0].value|default:'' }}

 

I don't want to rely on a static index of 2 as this could keep changing. 
 

1 reply

Userlevel 5
Badge +26

Hello @DiscoveryKitchen  Try something like this:

{% for item in event.extra.notes_attributes %}

{% if item.name==”shopflo_checkout_url” %}

// DO SOMETHNING HERE

{% endif %}

{% endfor %}

 

 

Reply