Skip to main content
Solved

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

  • February 23, 2023
  • 2 replies
  • 237 views

Forum|alt.badge.img+2

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...

Best answer by fgroast

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

View original
Did this topic or the replies in the thread help you find an answer to your question?

2 replies

Forum|alt.badge.img+2
  • Author
  • Problem Solver I
  • 3 replies
  • Answer
  • February 23, 2023

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


stephen.trumble
Community Manager
Forum|alt.badge.img+60

Hey @fgroast 

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