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

Need old dynamic attribute in the email template during update account

necoutinho
New Contributor III
New Contributor III

Hi Team,

WE are implementing a disconnected application. 

We have created dynamic attributes and are storing it in the customproperty of the account. We have an dynamic attribute - DocCode. The value of this is 'ABC' during creation of the account

On modify/account we are updating the dynamic attribute (e.g. DocCode) stored in customproperty1 to 'DEF'

I have configured email template to be sent on update account but I want to display - customproperty1 of account i.e. the old value of the DocCode - 'ABC' 

I tried using $ {accounts?.customproperty11} - which is not working

During creation when I want to display the accountname & doccode I am using below :

Accountname - $ {task?.accountName}

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

 

On update account but I want to display - customproperty1 of account i.e. the old value of the DocCode - 'ABC' . Can someone guide me how this can be achieved

8 REPLIES 8

pmahalle
All-Star
All-Star

Hi @necoutinho ,

You can create another dynamic attribute, which would be visible only on modify account form, keep it read-only, and map it to account's customproperty1. This attribute would show always old value present in CP1 of the account, use this newly created read only dynamic attribute in your email template which you want to send on update account using the below expression

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

Replace bold part with your new dynamic attribute name.


Pandharinath Mahalle(Paddy)
If this reply answered your question, please Accept As Solution to help other who may have a same problem. Give Kudos 🙂

necoutinho
New Contributor III
New Contributor III

Can't we simply pass the customproperty of the account in the email template?

These are the options I have tried

${task?.acccount.customproperty11} - not working
${accounts?.customproperty11} - not working
${accounts.customproperty11} - not working
${account_customproperty11} - not working
${account.customproperty11} - not working

sk
All-Star
All-Star

@necoutinho : User below logic to get oldvalue of dynamic attribute

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

 


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

This worked, thanks

rushikeshvartak
All-Star
All-Star

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

Old Value :

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


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

This is not working. The old value is coming as blank.

@necoutinho : Have you tried the suggestion I provided?


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

new value :

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

 

Old value 

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


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