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

Saviynt throwing error on Referencing Dynamic Attributes in Email Templates

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on November 25 2020 at 17:22 UTC

Hello ,


We have configured an Email Template on Task create and want to print the dynamic attributes configured on Endpoint on Email.

Based on Saviynt documentation, we have

configured it as : ${accessItems.collect{ it.request_access_attrss.find{it.attributeName.toString().equalsIgnoreCase('DLName')}.collect{it.attributeValue}}.get(0)}

.

This is not working and throwing error:

Populating Body

2020-11-25 11:08:20,408 [https-jsse-nio-443-exec-111] ERROR services.ArsTaskService - No such property: accessItems for class: SimpleTemplateScript1290

groovy.lang.MissingPropertyException: No such property: accessItems for class: SimpleTemplateScript1290

at SimpleTemplateScript1290.run(SimpleTemplateScript1290.groovy:2)

at com.saviynt.utility.TemplateUtilityService.getSimpleTemplateString(TemplateUtilityService.groovy:56)


Can anyone help on how can I pass dynamic attributes in email template

This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.
8 REPLIES 8

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on November 27 2020 at 05:57 UTC

Please refer to the documentation https://saviynt.freshdesk.com/a/solutions/articles/43000431557 on which property can be used on which email template. In this case accessItems doesn't seems to be a valid property to be used on task completion email template.

This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on November 27 2020 at 16:11 UTC

Thanks for the update Aditya

This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on May 10 2021 at 19:26 UTC

We tried: ${accessItems.collect{ it.request_access_attrss.find{it.attributeName.toString().equalsIgnoreCase('TestFreeText')}.collect{it.attributeValue}}}


And it worked, just FYI

This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on September 10 2021 at 17:48 UTC

Hi David,


You tried this in task create template?


Thanks,

Ved

This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on September 10 2021 at 19:18 UTC

Yes I believe we've used it in a request email template.  you'll need to be certain the field values you are asking for actually exist accurately or the template will throw an error. 

This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on September 10 2021 at 19:28 UTC

Thanks David, not sure if you can, but asking, is it possible to share email template you used (please remove any sensitive information before sharing. 

This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on November 10 2021 at 15:50 UTC

Sample from template POC we tested out using dynamic attributes in endpoint:

Favorite Food:<br>

${accessItems.collect{ it.request_access_attrss.find{it.attributeName.toString().equalsIgnoreCase('FavFood')}.collect{it.attributeValue}}.get(0)}<br><br>

<hr>

EnumField2:

${accessItems.collect{ it.request_access_attrss.find{it.attributeName.toString().equalsIgnoreCase('Enum2')}.collect{it.attributeValue}}.get(0)}<br>

<hr>


This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on November 10 2021 at 22:55 UTC

Hello David,


When are you triggering the email ? From the workflow at the time of request or from the endpoint, once the task is created, on create account, or on add access or on task completion etc ?





Regards,

Avinash Chhetri


This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.