Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Setting default manager account for Salesforce Account creation

akumar98
New Contributor
New Contributor

Hey,

We are trying to set default manager id in create account Json for Salesforce.

Below Json we are using, but account is not getting provision.

"ManagerId": "${ if (managerAccount == null || managerAccount?.accountID == null || managerAccount?.accountID == '' ){"0053M000003DEGXQA4"} else {managerAccount?.accountID} }"

We are getting below error in pending tasks-

Error in user creation errorCode: INVALID_OR_NULL_FOR_RESTRICTED_PICKLISTmessage: Site: bad value for restricted picklist field: null

Is there nay other way to add the correct json for this.

 

Thanks,

Aman 

14 REPLIES 14

Raghu
All-Star
All-Star

@akumar98  

"ManagerId": "${managerAccount == null || managerAccount.accountID == null || managerAccount.accountID == '' ? '0053M000003DEGXQA4' : managerAccount.accountID}"


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

NM
Honored Contributor II
Honored Contributor II

@akumar98 try this

"ManagerId": "${ if (managerAccount == null || managerAccount?.accountID == null || managerAccount?.accountID == '' ){'053M000003DEGXQA4'} else {managerAccount.accountID}}"

akumar98
New Contributor
New Contributor

Still we are getting the same error while provisioning

error- Error in user creation errorCode: INVALID_OR_NULL_FOR_RESTRICTED_PICKLISTmessage: Site: bad value for restricted picklist field: Shamokin

Shamokin is the city value for the user we are giving and create account json is like this-

{
"Username": "${user.email.concat('.GHB')}",
"Alias": "${user.firstname.toString().substring(0,1)}${user.lastname.toString().substring(0,4)}",
"LastName": "${user.lastname.concat(' GHB')}",
"FirstName": "${user.firstname}",
"Email": "${user.email}",
"IsActive": true,
"Title": "${user.jobcodedesc}",
"Site__c": "${user.city}",
"TimeZoneSidKey": "America/New_York",
"LocaleSidKey": "en_US",
"ReceivesInfoEmails": true,
"ReceivesAdminInfoEmails": true,
"CI_CignaLANId__c": "${user.customproperty1}",
"EmailEncodingKey": "ISO-8859-1",
"LanguageLocaleKey": "en_US",
"EmployeeNumber": "${user.employeeid}",
"ProfileId": "${profileId}",
"ManagerId": "${managerAccount == null || managerAccount.accountID == null || managerAccount.accountID == '' ? '0053M000003DEGXQA4' : managerAccount.accountID}",
"FederationIdentifier": "${user.employeeid}"
}

 

Thanks

NM
Honored Contributor II
Honored Contributor II

@akumar98 does that object value exist in Salesforce ?

Shamokin?

akumar98
New Contributor
New Contributor

We are setting that value under Site__c attribute by passing it from saviynt.

NM
Honored Contributor II
Honored Contributor II

@akumar98 yes understood that .. I was referring in Salesforce, does that value exist?

Also try by passing any other city.

akumar98
New Contributor
New Contributor

We don't have the access to Salesforce end. we are setting the attribute Site__c to user.city.

We also tried passing other city value but getting the same error.

Error in user creation errorCode: INVALID_OR_NULL_FOR_RESTRICTED_PICKLISTmessage: Site: bad value for restricted picklist field: Shamokin

 

 

NM
Honored Contributor II
Honored Contributor II

@akumar98 issue on target end .. check with Salesforce team.

akumar98
New Contributor
New Contributor

Thanks for that.

Also how can we check the  uniqueness on the FederationIdentifier when creating the account, and if the EID value is taken, set it to email?

Raghu
All-Star
All-Star

@akumar98  try

{
"Username": "${user.email.concat('.GHB')}",
"Alias": "${user.firstname.toString().substring(0,1)}${user.lastname.toString().substring(0,4)}",
"LastName": "${user.lastname.concat(' GHB')}",
"FirstName": "${user.firstname}",
"Email": "${user.email}",
"IsActive": true,
"Title": "${user.jobcodedesc}",
"Site__c": "${user.city}",
"TimeZoneSidKey": "America/New_York",
"LocaleSidKey": "en_US",
"ReceivesInfoEmails": true,
"ReceivesAdminInfoEmails": true,
"CI_CignaLANId__c": "${user.customproperty1}",
"EmailEncodingKey": "ISO-8859-1",
"LanguageLocaleKey": "en_US",
"EmployeeNumber": "${user.employeeid}",
"ProfileId": "${profileId}",
"ManagerId": "${ if (managerAccount == null || managerAccount?.accountID == null || managerAccount?.accountID == '' ){"0053M000003DEGXQA4"} else {managerAccount?.accountID} }",
"FederationIdentifier": "${user.employeeid}"
}


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

akumar98
New Contributor
New Contributor

Hey raghu, we have tried the same json in our existing create account json and still we are getting the same error.

Error in user creation errorCode: INVALID_OR_NULL_FOR_RESTRICTED_PICKLISTmessage: Site: bad value for restricted picklist field: Shamokin

 

@akumar98  check with Salesforce team once,

FederationIdentifier value for email use below

"FederationIdentifier":"${user?.getEmail()}"


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

akumar98
New Contributor
New Contributor

Hey raghu,
Thanks for the response.

Our requirement is like this-

Some users will have multiple Salesforce accounts. If they do, their first FederationIdentifer will be their EID, and their second FederationIdentifier will be their email. Is there a way to check for uniqueness on the FederationIdentifier when creating the account, and if the EID value is taken, set it to email?

rushikeshvartak
All-Star
All-Star

"ManagerId": "${ (managerAccount != null && managerAccount.accountID != null && managerAccount.accountID != '') ? managerAccount.accountID : '0053M000003DEGXQA4' }"


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.