Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Duplicate values getting updated in the email templates when selecting entitlements

necoutinho
New Contributor III
New Contributor III

We are using dynamic attributes in the form and inorder to populate these attributes in the email we are using below syntax :

ReqUserName - ${ACCOUNTNAME}
New User - ${accessItems.collect{ it.request_access_attrss.find{it.attributeName.toString().equalsIgnoreCase('NewUser')}.collect{it.attributeValue}.join('###')}.toString().replaceAll('\\[','').replaceAll('\\]','').replaceAll('\\,','')}
Company Code - ${accessItems.collect{ it.request_access_attrss.find{it.attributeName.toString().equalsIgnoreCase('Companycode')}.collect{it.attributeValue}.join('###')}.toString().replaceAll('\\[','').replaceAll('\\]','').replaceAll('\\,','')}
Limit - ${accessItems.collect{ it.request_access_attrss.find{it.attributeName.toString().equalsIgnoreCase('Limit')}.collect{it.attributeValue}.join('###')}.toString().replaceAll('\\[','').replaceAll('\\]','').replaceAll('\\,','')}
Access Code - ${entitlements}

necoutinho_0-1706099438204.png

The challenge here is when we select entitlements the dynamic attributes gets duplicated. e.g. if you can see in the attached screenshot - if no entitlements are selected it displays correctly. If we select 1 entitlement - the value gets duplicated. We select 2 entitlements - the value gets duplicated thrice and so on.

I am unable to understand what is the problem and if there is some problem with the syntax that I am using here

1 REPLY 1

rushikeshvartak
All-Star
All-Star

Its showing per item in request access object

if account + 1 access then two entries 

use below syntax

${task?.requestAccessKey?.collect{it.request_access_attrss.findAll{it.attributeName.toString().equalsIgnoreCase('accttype')}.collect{it.attributeValue}}.get(0)}

 

ReqUserName - ${ACCOUNTNAME}
New User - ${accessItems.collect{ it.request_access_attrss.find{it.attributeName.toString().equalsIgnoreCase('NewUser')}.collect{it.attributeValue}.get(0).join('###')}.toString().replaceAll('\\[','').replaceAll('\\]','').replaceAll('\\,','')}
Company Code - ${accessItems.collect{ it.request_access_attrss.find{it.attributeName.toString().equalsIgnoreCase('Companycode')}.collect{it.attributeValue}.get(0).join('###')}.toString().replaceAll('\\[','').replaceAll('\\]','').replaceAll('\\,','')}
Limit - ${accessItems.collect{ it.request_access_attrss.find{it.attributeName.toString().equalsIgnoreCase('Limit')}.collect{it.attributeValue}.get(0).join('###')}.toString().replaceAll('\\[','').replaceAll('\\]','').replaceAll('\\,','')}
Access Code - ${entitlements}


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.