Skip to main content
Problem Solver I
February 23, 2023
Solved

Using the 'split' filter - how do I select the third item in the array?

  • February 23, 2023
  • 2 replies
  • 404 views

I’m using a dynamic lookup in an email template that looks like this:

{{ person|lookup:'PRODUCTS: product_0_name'|split:'/' }}

Which returns an array that looks like this: 

['Product Name', ' Product Size ', ' Product Variant']

What filter do I need to add after the “split” to display only the first item in the returned array? 

Appreciate it...

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

    A… figured it out “|first” works for my needs. 

    2 replies

    fgroastAuthorAnswer
    Problem Solver I
    February 23, 2023

    A… figured it out “|first” works for my needs. 

    stephen.trumble
    Klaviyo Alum
    February 23, 2023

    Hey @fgroast 

    Congrats on your first post and figuring out a solution that works for you! So happy to have you in the community!

    -Stephen