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

Can we use a substring in the email template for dynamic attributes

necoutinho
New Contributor III
New Contributor III

Hi Team,

We are using below syntax to display the dynamic attribute of a disconnected application on task creation

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

Output of this is - Finance Report - FRI

However we want to display only 'FRI' in the email template. Can we apply any substring to the above syntax

5 REPLIES 5

rushikeshvartak
All-Star
All-Star

$ {task?.requestAccessKey?.collect{it.request_access_attrss.findAll{it.attributeName.toString().equalsIgnoreCase('FinCode')}.collect{it.attributeValue.split("-")}}.get(0).join(', ')}


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

Tried this but when i try to save the Email template it says - "Operation not allowed as you are entering a value that resembles or contains script code"

AM

$ {task?.requestAccessKey?.collect{it.request_access_attrss.findAll{it.attributeName.toString().equalsIgnoreCase('FinCode')}.collect{it.attributeValue.split('-')}}.get(0).join(', ')}


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

Saathvik
All-Star
All-Star

@necoutinho : Try below

${task?.requestAccessKey?.collect{ it.request_access_attrss.find{it.attributeName.toString().equalsIgnoreCase('FinCode')}.collect{it.attributeValue}}.get(0).split("-")[1]}

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

necoutinho
New Contributor III
New Contributor III

Thank you this worked