1

Previously I was using separate email context for different subjects and I was doing something like this.

enter image description here

Now I want to fetch organization name from VM file only from formRowModels but this is giving an error.

${ctx.formRowModels.stream().filter(row -> row.getKey().contains("Organization"))}

enter image description here

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
  • 1
    Please [DO NOT post images](https://stackoverflow.com/help/how-to-ask) of code, data, error messages, etc. - copy or type the text into the question. – Sandra Rossi Oct 06 '22 at 16:39

1 Answers1

1

This is because when you're writing code in a VM file, you're not using Java but VTL (Velocity Template Language). You need to filter the desired value using a combination of #foreach & #if #else directives.

Example:

#foreach ($row in $ctx.yourList)
    #if ($row ... )
     doSomethingHere 
    #end
#end
user1234SI.
  • 1,812
  • 1
  • 8
  • 22