Click HERE to see how Saviynt Intelligence is transforming the industry. |
07/30/2024 05:19 AM - edited 07/30/2024 07:23 AM
Hi Team,
we have to print a value based on dynamic attribute value chosen by user while submitting the request.
I tried comparing the value, but email fails
Tried these 2 didn't work
<% if ("${accessItems.collect{it.request_access_attrss.findAll{it.attributeName.toString().equalsIgnoreCase('DAJUST')}.collect{it.attributeValue}}.get(0).toString().replace('[','').replaceA(']','')}"=="other") print "test1" else print "testelse" %>
<% if (${accessItems.collect{it.request_access_attrss.findAll{it.attributeName.toString().equalsIgnoreCase('DAJUST')}.collect{it.attributeValue}}.get(0).toString().replace('[','').replaceA(']','')}=="other") print "test1" else print "testelse" %>
if any other way we can compare dynamic attribute and its value.
Thanks
@rushikeshvartak @PremMahadikar @naveenss , anything which I can try for above query.. bit urgent for us
Solved! Go to Solution.
07/30/2024 07:49 AM
Hi @NM ,
Did you try below code from documentation?
${accessItems.findAll{it.request_access_attrss.size()}.collect{it.request_access_attrss.findAll{!it.attributeName.toString().equalsIgnoreCase('ENT_BY_RULE_ADD'))}.collect{it.attributeName.toString() + ':' +it.attributeValue}.join('###')}} | Obtains all the dynamic attributes in the request. |
${accessItems.collect{ it.request_access_attrss.find{it.attributeName.toString().equalsIgnoreCase('Location')}.collect{it.attributeValue}}.get(0)} ${accessItems.collect{ it.request_access_attrss.find{it.attributeName.toString().equalsIgnoreCase('Location')}.collect{it.attributeValue}}} where, Location is the dynamic attribute name. | Obtains the name of a particular dynamic attribute and its value f |
If this helps, please consider selecting Accept As Solution and hit Kudos
08/12/2024 07:17 AM
When I try this I get this error while saving the email template"Operation not allowed as you are entering a value that resembles or contains script code"
"${accessItems.findAll{it.request_access_attrss.size()}.collect{it.request_access_attrss.findAll{!it.attributeName.toString().equalsIgnoreCase('ENT_BY_RULE_ADD'))}.collect{it.attributeName.toString() + ':' +it.attributeValue}.join('###')}}"
08/12/2024 07:20 AM - edited 08/12/2024 07:20 AM
Hi @shine,
Till this part it will print
${accessItems.collect{ it.request_access_attrss.find{it.attributeName.toString().equalsIgnoreCase('Location')}.collect{it.attributeValue}}.get(0)}
08/12/2024 07:49 AM
I tried-
${accessItems.findAll{it.request_access_attrss.size()}.collect{it.request_access_attrss.findAll{!it.attributeName.toString().equalsIgnoreCase('ENT_BY_RULE_ADD'))}
"Operation not allowed as you are entering a value that resembles or contains script code" is the error I get while saving it
08/12/2024 07:53 AM
Try below @shine
${accessItems.collect{ it.request_access_attrss.find{it.attributeName.toString().equalsIgnoreCase('Location')}.collect{it.attributeValue}}.get(0)}
07/30/2024 08:42 AM
Hi @PremMahadikar , I was able to print the value but comparing the dynamic attribute with multiple value wasn't working but i was able to figure it out..
Thank you for your help!!