Map in Velocity | Community
Skip to main content
Level 2
September 20, 2023
Question

Map in Velocity

  • September 20, 2023
  • 0 replies
  • 468 views

Hi, I have a map 

#set ($mymap={"keyname":"value1,value2"})

The key name will be dynamic in my case, hence tried

"$mymap[$dynamickeyname]" where $dynamickeyname evaluates to keyname. But throws a parse error.

It is not working in the target's velocity template.

I have tried $!mymap.get("$!dynamickeyname") as well which is not working either.

Can you please assist with the right syntax to retrieve the map values dynamically.

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.