Hi Team,
I would like to skip the entity.Id if its attribute (entity.offerId) has already been shown in the recommendations. I am trying to use velocity logic but this is not running as expected:
The design :
#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 in request :
"content": "OFF-56938,\nOFF-44046,\nOFF-27626,\nOFF-60503,\nOFF-49318,\nOFF-52824,\n1355738,\nOFF-13099,\nOFF-27626,\nOFF-11757,\n1355717,\nOFF-27305,\nOFF-42752,\n\n ",
I do not want OFF-27626 to reappear again.Each offerId has unique entity.id.
Any help on this would be really appreciated.