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

Required IF else condition syntax in AD connection for create account JSON

Harish1
New Contributor II
New Contributor II

Hi,

We have a requirement i.e., if saviynt has preferredfirstname then it will be the first name in AD, else Saviynt's firstname will be as firstname in AD.

Kindly suggest me the JSON format at connection level.

7 REPLIES 7

pmahalle
All-Star
All-Star

Hi @Harish1 ,

Try below and check:

"givenName": "${if(user?.preferedFirstName!=null){user.preferedFirstName} else {user.firstname}}"


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

Harish1
New Contributor II
New Contributor II

Hi 

Thanks for your response, I've tested using ternary operator. 

"givenName": "${user.preferedFirstName!=null?user.preferedFirstName:user.firstname}" in update account JSON and tested for two users getting below error while running provisioning job. Kindly suggest.

Error while update account in AD : Cannot get property 'url' on null object

Hi Pandharinath,

Can we provide the if else condition with check of certain value.

like below:

"givenName": "${if(user.Location=='India'){user.preferedFirstName} else {user.firstname}}"

 

And how can be used to send update to SNOW create / update JSON.

SumathiSomala
All-Star
All-Star

@Harish1 

Using if-else

"givenName": "${if(user.preferedFirstName!=null){user.preferedFirstName} else {user.firstname}}"

Using ternary operator
"givenName": "${user.preferedFirstName!=null?user.preferedFirstName:user.firstname}"

 

Regards,
Sumathi Somala
If this reply answered your question, please Accept As Solution and give Kudos.

Hi Sumathi,

Thanks for your response, I've tested the above in update account JSON and tested for two users getting below error while running provisioning job. Kindly suggest.

Error while update account in AD : Cannot get property 'url' on null object

@Harish1 ,

Can you share your CreateAccount JSON


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

Harish1
New Contributor II
New Contributor II

Thanks for the help, as revalidated the issue is resolved.