and more in a single search tool across platforms. Read the announcement here. |
02/28/2024 06:43 AM
Hi,
Requirement is to fetch the dynamic attribute value of type "SQL Multi Select" in new account task completion email template.
Dynamic attribute config:
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:
Error:
java.lang.StringIndexOutOfBoundsException: String index out of range: 3 at java.lang.String.substring(String.java:1963) at SimpleTemplateScript649$_run_closure11_closure38.doCall
02/28/2024 07:51 AM
@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('\\,','')}
02/28/2024 07:59 PM
task?.requestAccessKey?.collect { it?.request_access_attrss?.findAll { attr -> attr?.attributeName?.toString()?.equalsIgnoreCase('UserNameDepartment') }?.collect { attr -> attr?.attributeValue } }?.flatten()?.join(', ') ?: 'N/A'