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

getting dynamic attributes in email template subject

Bhargav
New Contributor
New Contributor

Hi Team,

Is it possible to get dynamic attribute value in workflow email template subject for evaluating conditon.

I tried the below condition in email body i'm able to get the value but when i tried to place it in subject and updating the email template getting the below error.

<% if (accessItems.collect{it.request_access_attrss.find{it.attributeName.toString().equalsIgnoreCase('customproperty44')}.collect{it.attributeValue}}.get(0).toString().replaceAll('\\[','').replaceAll('\\]','').replaceAll('\\,','') == 'Leaver Request') print "Leaver Request ${requestid} has been rejected." else print "India" %>

error:

Bhargav_0-1697086517911.png

Can someone help me on this?

Regards,

Bhargav.

3 REPLIES 3

sudeshjaiswal
Saviynt Employee
Saviynt Employee

Is it possible to get dynamic attribute value in workflow email template subject for evaluating conditon?

Ans: Can you try enabling this configuration under global configuration> misc > workflow

"Expose hidden dynamic attributes in workflow": This would help you to pass dynamic attributes that are hidden from the request form and have a default value set as a query/string etc as per the explanation provided in doc.
https://docs.saviyntcloud.com/bundle/SSM-Admin-v55x/page/Content/Chapter11-Workflows/Workflow-Compon... 
https://docs.saviyntcloud.com/bundle/EIC-Admin-v23x/page/Content/Chapter12-Workflows/Workflow-Compon... 


I tried the below condition in email body i'm able to get the value but when i tried to place it in subject and updating the email template getting the below error.


<% if (accessItems.collect{it.request_access_attrss.find{it.attributeName.toString().equalsIgnoreCase('customproperty44')}.collect{it.attributeValue}}.get(0).toString().replaceAll('\\[','').replaceAll('\\]','').replaceAll('\\,','') == 'Leaver Request') print "Leaver Request ${requestid} has been rejected." else print "India" %>

 

Ans: Can you please verify if it's possible to print the dynamic attribute value in the subject without the need for any conditional statements?
If this approach doesn't yield the desired result, it might not be suggest that that binding variable is not supported.

To check the supported binding variable: you below to get the list of binding variable supported.
${this.binding.variables.each {k,v -> println "$k = $v" + "<" + "br" + ">"}}

Some Of the Forum Post For your reference, who have faced the similar issue in the past.

https://forums.saviynt.com/t5/identity-governance/email-template-subject-error-operation-not-allowed... 
https://forums.saviynt.com/t5/identity-governance/email-template-subject-line-out-of-bounds-error/td... 

Thanks.

If you find the above response useful, Kindly Mark it as "Accept As Solution".

sk
All-Star
All-Star

@Bhargav : If you are using this in subject look at the character length, Because subject datatype is varchar(255). Looking at your content it is crossing the char length which might be causing the issue


Regards,
Saathvik
If this reply answered your question, please Accept As Solution and give Kudos to help others facing similar issue.

rushikeshvartak
All-Star
All-Star

Raise saviynt support ticket to allow adding script on email url. Its blocking cross site scripting on save page of email template. Email template TO size is 1024 hence you should be able to do same


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