and more in a single search tool across platforms. Read the announcement here. |
01/24/2024 04:38 AM
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}
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
01/24/2024 11:56 AM - edited 01/24/2024 11:59 AM
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}