We are delighted to share our new EIC Delivery Methodology for efficiently managing Saviynt Implementations and delivering quick time to value. CLICK HERE.

Salesforce - Substring in modify account json.

Varshi_Balaji
New Contributor III
New Contributor III

Hi Team,

We tried to add substring function in modify account json in Salesforce out of the box connector.

The substring function is not working. It is not giving any error but the data is not getting reflected as expected.

{
"Alias": "${user.firstname.toString().substring(0,1)}${user.lastname.toString().substring(0,3)}",
"Email": "${user.email}",
"FirstName": "${user.firstname}",
"LastName": "${user.lastname}",
"TimeZoneSidKey": "Europe/Paris",
"LocaleSidKey": "fr_FR",
"LanguageLocaleKey": "FR",
"Area__c": "${user.customproperty35}",
"Branch__c": "FR${user.customproperty3}${user.customproperty17}",
"Street": "${user.locationdesc}",
"Zone__c": "${user.customproperty33}",
"PostalCode": "${user.regioncode}",
"City": "${user.city}",
"Job_Title_Payroll__c": "${user.customproperty27}",
"Username": "${if(((user.departmentNumber!=account.customproperty23.substring(3,5)) && (user.customproperty30==account.customproperty27))||((user.departmentNumber==account.customproperty23.substring(3,5)) && (user.customproperty30!=account.customproperty27))){user.email+'.everest'} else if(((user.departmentNumber!=account.customproperty23.substring(3,5)) && (user.customproperty30!=account.customproperty27))|| user.customproperty3!=account.customproperty31||user.customproperty9=='Terminated'|| user.customproperty21=='ASAP'){user.email+'.everest'+'_'+Calendar.getInstance().getTime().format('yyyyMMdd')} else {user.email+'.everest'}}",
"IsActive": "${if(user.customproperty29=='Active'){true}}"
}

Could you please check and let us know.

Regards,

Varshitha

 

7 REPLIES 7

SB
Saviynt Employee
Saviynt Employee

Can you confirm the value you are expecting vs the value that is getting populated and for which field. Also, do you see the data getting populated in the logs for the Substring function you are using?


Regards,
Sahil

Varshi_Balaji
New Contributor III
New Contributor III

Hi Sahil

We need substring to check if user dept is matching the accout cp23 and if that matches then user email should be print.

We did not find substring in the logs

Regards,

Varshitha

SB
Saviynt Employee
Saviynt Employee

Can you confirm the actual value of the attribute that you want the substring of and the value you are trying to match it with.


Regards,
Sahil

Varshi_Balaji
New Contributor III
New Contributor III

Hi Sahil,

We want substring function for accounts cp23 and we are matching with user's dept number.

Regards,

Varshita

SB
Saviynt Employee
Saviynt Employee

You can use the substring function based on the values you need to extract from the original attribute value in your json. Below is a reference.

(user.departmentNumber!=account.customproperty23.substring(1,4))


Regards,
Sahil

Varshi_Balaji
New Contributor III
New Contributor III

Hi Sahil,

As mentioned in the above json, we are using the same format. Tasks are getting completed but it is not reflected in target.

user.departmentNumber!=account.customproperty23.substring(3,5))

We require to check in below conditions.

Accounts cp23 - FR65800

User's dept number- 65800

So we are using account.customproperty23.substring(3,5), so that we can compare user's dept number(65800) to account;s cp23(65800) without FR. So we gave the condition1(3,5) to check from 3rd position for 5 counts.i.e, 65800.

Regards,

Varshitha

SB
Saviynt Employee
Saviynt Employee

The value you need to use is substring(2,7) to match value 65800


Regards,
Sahil