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

Help Adding to Active Directory multi-valued attribute during provisioning

New Contributor II
New Contributor II

Hello experts! We're trying to configure Active Directory connection to "add" only to a multi-valued proxyAddresses attribute. We do not track the existing proxyAddresses anywhere in Saviynt and thus cannot append to the field. We would like to add only on username changes to verify that the new username@domain is on the AD object. All help is appreciated!  

Example for me..
EXISTING AD.ProxyAddresses
proxyAddresses: {
I change my email address....
proxyAddresses: {,


Previous ticket reference, unsolved, was: 1261682


Saviynt Employee
Saviynt Employee

Hi @KenKoch 

can you refer the below article,

You need to store the proxy address in some CP value and append as discussed in that article





First you need to pull existing proxy addresses to any of the account CP by using below format in ACCOUNT_ATTRIBUTE mapping. Make sure that CP you have used is of type Longtext to avoid truncation of data.


After that while provisioning you can append the latest email to current list as below



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

New Contributor II
New Contributor II

I follow what you've done, but that isn't a complete solution for me. It's very helpful to know that I can use task.accountKey as a reference point to the account CP though.

In Groovy, here's the entire block of code I would like to run. Is it possible to drop this into a dynamic attribute or inline in the updateAccountJSON?


Hi @KenKoch 

This looks like a specific custom code written as per requirement, the exact same cant be applied in saviynt as said above by @Saathvik  and by link,  you can update the proxyaddress.

If the request is via ARS, then possible solution may be write a custom jar and then invoke a sql query to fetch the Proxyaddress via method and see if you can populate the value.




New Contributor II
New Contributor II

@Saathvik  @Darshanjain 
Thanks for the tips, that got me 99% of the way there. I am stuck due to the AD change map not detecting case sensitive data changes on the multi-value attributes. Any help would be much appreciated! It shows the correct data from my Groovy, but when it builds the change map to flow out there are no changes... the case on the  "smtp" prefix changes though.

In the debug logs I see this, sorted ascending:

2023-07-07/19:45:03.684 [{}] [quartzScheduler_Worker-2] DEBUG ldap.SaviyntGroovyLdapService - DataMap-[proxyAddresses:[,]...

2023-07-07/19:45:03.858 [{}] [quartzScheduler_Worker-2] DEBUG ldap.SaviyntGroovyLdapService - LDAP Account Attrs-[proxyaddresses:[,]...

2023-07-07/19:45:03.861 [{}] [quartzScheduler_Worker-2] DEBUG ldap.SaviyntGroovyLdapService - dataList-[,]

2023-07-07/19:45:03.861 [{}] [quartzScheduler_Worker-2] DEBUG ldap.SaviyntGroovyLdapService - values2beAdded (lowercased) = []

2023-07-07/19:45:03.861 [{}] [quartzScheduler_Worker-2] DEBUG ldap.SaviyntGroovyLdapService - dataMapListMap = [,]

2023-07-07/19:45:03.861 [{}] [quartzScheduler_Worker-2] DEBUG ldap.SaviyntGroovyLdapService - deleteDataMap = [:]




Here's the code I ended up using in the updateAccountJSON:

"proxyAddresses": [${

String proxyAddresses = task?.accountKey.customproperty56;
String systemUserName = user.systemUserName;
String userEmail =;
String domainName = 'myEmailRoutingDomain';
if (proxyAddresses == null) {proxyAddresses = ''}
proxyAddresses = proxyAddresses.trim();
String primarySMTPAddress = (userEmail != null) ? 'SMTP:' + userEmail.toLowerCase() : 'SMTP:' + systemUserName.toLowerCase() + '@' + domainName.toLowerCase();
String routingSMTPAddress = 'smtp:' + systemUserName.toLowerCase() + '@' + domainName.toLowerCase();

if (!(proxyAddresses.toLowerCase().contains(primarySMTPAddress.toLowerCase()))) {
    proxyAddresses = proxyAddresses + ',' + primarySMTPAddress;
if (!(proxyAddresses.toLowerCase().contains(routingSMTPAddress.toLowerCase()))) {
    proxyAddresses = proxyAddresses + ',' + routingSMTPAddress;
Set<String> uniqueAddresses = new LinkedHashSet<>();
boolean primaryAddressFound = false;
String[] addressesArray = proxyAddresses.split(',');
for (String address : addressesArray) {
    address = address.trim();
    boolean issmtp = address.toLowerCase().startsWith('smtp:');
    boolean isPrimary = (address.equalsIgnoreCase(primarySMTPAddress));
    if (issmtp && isPrimary && !primaryAddressFound) {
        primaryAddressFound = true;
    } else if (issmtp) {
    } else {
StringBuilder formattedAddresses = new StringBuilder();
for (String address : uniqueAddresses) { formattedAddresses.append('"').append(address).append('", '); }
String formattedProxyAddresses = formattedAddresses.toString();
if (formattedProxyAddresses.endsWith(', ')) { formattedProxyAddresses = formattedProxyAddresses.substring(0, formattedProxyAddresses.length() - 2); }
return formattedProxyAddresses;



store old proxyAddress in cp51 of account during reconciliation 

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


That results in a the CP51 being added as a single value, plus the new value... without the capitalization appropriately implemented. Is there something configured wrong on our multi-value import?

Value in CP51 prior to updateAccount:



After updateAccount in AD actual proxyAddresses:

Value 1:,
Value 2:

So it removed ? Or override 

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

It used the CP value as a single string in one position of the array, then appended the new value as the second array value but in lowercase instead of the literal SMTP string. 

Can you share with example

before update cp51 

actual expected in target

after in cp51

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


account attribute config:


PRE-update task
Saviynt account customproperty56 :,

Active Directory proxyAddresses:

Expected AD proxyAddresses AFTER update:

POST-update task..
Actual AD proxyAddresses AFTER update:

[This post has been edited by a Moderator to remove sensitive information.]