Solved

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

  • 23 February 2023
  • 2 replies
  • 76 views

Badge +1

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

icon

Best answer by fgroast 23 February 2023, 21:37

View original

2 replies

Badge +1

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

Userlevel 7
Badge +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!

Reply