Skip to main content
New Member
July 13, 2024
Solved

How to i filter an array on an event?

  • July 13, 2024
  • 1 reply
  • 150 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. 
 

    This topic has been closed for replies.
    Best answer by Maxbuzz

    Hello @DiscoveryKitchen  Try something like this:

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

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

    // DO SOMETHNING HERE

    {% endif %}

    {% endfor %}

     

     

    1 reply

    MaxbuzzAnswer
    Partner
    July 13, 2024

    Hello @DiscoveryKitchen  Try something like this:

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

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

    // DO SOMETHNING HERE

    {% endif %}

    {% endfor %}

     

     

    https://theforms.pro