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

SQL Multiselect dynamic attribute value in task completion email template

Aditya
New Contributor
New Contributor

Hi,

Requirement is to fetch the dynamic attribute value of type "SQL Multi Select" in new account task completion email template.

Aditya_0-1709130706041.png

Dynamic attribute config:

Aditya_1-1709130735912.png

 

Currently we are able to fetch the value of 'SQL ENUM' (SQL single select) dynamic attribute in the new account task completion email using below code:

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

 

Is there any way to fetch the above mentioned "Username" dynamic attribute of type "SQL Multi Select".

I tested the below approach but it failed:

  1. UserName - ${task?.requestAccessKey?.collect{it.request_access_attrss.findAll{it.attributeName.toString().equalsIgnoreCase('UserNameDepartment')}.collect{it.attributeValue}}}.get(0)}
  2. UserName - ${task?.requestAccessKey?.collect{it.request_access_attrss.findAll{it.attributeName.toString().equalsIgnoreCase('UserNameDepartment')}.collect{it.attributeValue}}}

Error:

java.lang.StringIndexOutOfBoundsException: String index out of range: 3 at java.lang.String.substring(String.java:1963) at SimpleTemplateScript649$_run_closure11_closure38.doCall

2 REPLIES 2

Raghu
All-Star
All-Star

@Aditya  try lbelow

${task?.requestAccessKey?.collect{it.request_access_attrss.findAll{it.attributeName.toString().equalsIgnoreCase('UserNameDepartment')}.collect{it.attributeValue}}.get(0).toString().replaceAll('\\[','').replaceAll(']','')}

 

${String.valueOf(task?.requestAccessKey?.collect{it.request_access_attrss.findAll{it.attributeName.toString().equalsIgnoreCase('UserNameDepartment')}.collect{it.attributeValue}}.get(0)).replaceAll('\\[','').replaceAll(']','')}


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

${accessItems.collect{it.request_access_attrss.findAll{it.attributeName.toString().equalsIgnoreCase('UserNameDepartment')} .collect{it.attributeName.toString() + ': ' + it.attributeValue}.join('###')}.toString().replaceAll('\\[','').replaceAll('\\]','').replaceAll('\\,','')}

 


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

rushikeshvartak
All-Star
All-Star

task?.requestAccessKey?.collect { it?.request_access_attrss?.findAll { attr -> attr?.attributeName?.toString()?.equalsIgnoreCase('UserNameDepartment') }?.collect { attr -> attr?.attributeValue } }?.flatten()?.join(', ') ?: 'N/A'


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