4

I am trying to use VTL for the first time and cannot see to get arrays to grab an inputted String.

I have tried "in" (but I do not believe this is a key word in this language), as well .contains() below (but it does not find the string inside the created array)

Code Below for Use Case Reference:

#set($MSpanish = ["Argentina", "Belize"])
#elseif($MSpanish.contains(${lead.Country}))
   #set($subject = "hellow world")

What keyword would I use instead of contains? Is there any keyword that would save the time of many if statements with == in VTL?

JosephF
  • 35
  • 1
  • `[...]` in VTL creates a Java ArrayList which has a `contains` method (https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#contains-java.lang.Object-) so it should work. Your code snippet isn't valid (#elseif without #if, and no #end). When I fix it up, it works for me. Can you provide more code? – Zac Charles Apr 03 '21 at 10:05

0 Answers0