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

Salesforce community nickname attribute limited to 40 characters

Varshi_Balaji
Regular Contributor
Regular Contributor

Hi Team,

In Salesforce out of the box coonector we are updating community nickname in the format of users's firstname.lastname.employeeid . community nickname limited to 40 characters so if firstname.lastname.employeeid combination exceeds 40 characters then the attribute will not be updated.
Can we acheive this by adding length condition in the json? If firstname.lastname.employeeid exceeds 40 characters print only firstname.lastname

 

Regards,

Varshita

6 REPLIES 6

sahajranajee
Saviynt Employee
Saviynt Employee

Hi @Varshi_Balaji ,

Yes you should be able to use ternary operators along with methods like length to do this calculation.
Example : "CommunityNickname": "${user?.email.substring(0,user.email.lastIndexOf("@"))}",


Regards,
Sahaj Ranajee
Sr. Product Specialist

Hi Sahaj,

I used length in the json, but it gave me not supported.

This is the below json

 

"CommunityNickname": "${if((user.departmentNumber!=account.customproperty23.substring(3,5) && user.customproperty30!=account.customproperty27)|| user.employeeid.contains('_OLD_')||user.customproperty9=='Terminated'|| user.customproperty21=='As soon as possible') || length({user.firstname.toString()+'.'+user.lastname.toString()+'.'+user.employeeid})<40 {user.firstname.toString()+'.'+user.lastname.toString()+'.'+user.employeeid+'_'+Calendar.getInstance().getTime().format('yyyyMMdd')} else {user.firstname.toString()+'.'+user.lastname.toString()}}"

 

Regards,

Varshita

sahajranajee
Saviynt Employee
Saviynt Employee

Hi Varshita,

That is not how length() method is supposed to be used. Its used as :

somestringstoringvariable.length()

 


Regards,
Sahaj Ranajee
Sr. Product Specialist

Hi Sahaj,

We tried in this format also (user.firstname.length() > 40), I'm getting error length is not supported.

Reagrds,

Varshita

sahajranajee
Saviynt Employee
Saviynt Employee

Hello,

It would help if you post the json you are using along with the provisioning logs.

 


Regards,
Sahaj Ranajee
Sr. Product Specialist

Hi Sahaj,

Below is the modify account json, will post the logs in sometime.

{
"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.departmentNumber}",
"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.employeeid.contains('_OLD_')||user.customproperty9=='Terminated'|| user.customproperty21=='As soon as possible'){user.email+'.everest'+'_'+Calendar.getInstance().getTime().format('yyyyMMdd')} else {user.email+'.everest'}}",
"CommunityNickname": "${if((user.departmentNumber!=account.customproperty23.substring(3,5) && user.customproperty30!=account.customproperty27)|| user.employeeid.contains('_OLD_')||user.customproperty9=='Terminated'|| user.customproperty21=='As soon as possible')||(user.firstname.length() > 4 ) {user.firstname.toString()+'.'+user.lastname.toString()+'.'+user.employeeid+'_'+Calendar.getInstance().getTime().format('yyyyMMdd')}}",
"FederationIdentifier": "${if((user.departmentNumber!=account.customproperty23.substring(3,5) && user.customproperty30!=account.customproperty27)|| user.employeeid.contains('_OLD_')||user.customproperty9=='Terminated'|| user.customproperty21=='As soon as possible'){user.email+'_'+Calendar.getInstance().getTime().format('yyyyMMdd')} else {user.email}}",
"TECH_ExternalKey__c": "${if((user.departmentNumber!=account.customproperty23.substring(3,5) && user.customproperty30!=account.customproperty27)|| user.employeeid.contains('_OLD_') || user.customproperty9=='Terminated' || user.customproperty21=='As soon as possible'){'FR'+user.employeeid+'_'+Calendar.getInstance().format('yyyyMMdd')} else {'FR'+user.employeeid}}",
"DeactivationDate__c": "${if(user.employeeid.contains('_OLD_') || user.customproperty9=='Terminated' || user.customproperty21=='As soon as possible'){user.enddate.format('yyyy-MM-dd')}else {Calendar.getInstance().getTime().format('yyyy-MM-dd')}}",
"IsActive": "${if(user.customproperty29=='1'){true}}"
}