I want to skip the duplicate values so using below code but it seems not working.
#set($uniqueEntities=[])
#foreach($e in $entities)
#if($foreach.index <=12)
#if($uniqueEntities != ($e.offerId))
#set($uniqueEntities=$e.offerId)
#end
$uniqueEntities,
#set($foreach.index = $foreach.index + 1)
#end
#end
Response : OFF-56938,OFF-44046,OFF-27626,OFF-60503,OFF-49318,OFF-52824,1355738,OFF-13099,OFF-27626,OFF-11757,1355717,OFF-27305,OFF-42752
I do not want OFF-27626 to reappear. How could we fix this please?
Without actually knowing velocity.js, looking at this answer I think this might work for you