and more in a single search tool across platforms. Read the announcement here. |
04/12/2022 01:16 PM
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
Solved! Go to Solution.
04/12/2022 02:45 PM
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.
04/12/2022 02:45 PM
Thanks for the update Aditya
04/12/2022 02:45 PM
We tried: ${accessItems.collect{ it.request_access_attrss.find{it.attributeName.toString().equalsIgnoreCase('TestFreeText')}.collect{it.attributeValue}}}
And it worked, just FYI
04/12/2022 02:45 PM
Hi David,
You tried this in task create template?
Thanks,
Ved
04/12/2022 02:45 PM
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.
04/12/2022 02:45 PM
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.
04/12/2022 02:45 PM
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>
04/12/2022 02:45 PM
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