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

if else REST UpdateAccountJSON isn't working

cgowda
New Contributor III
New Contributor III

Hi Experts,

We have a use case to push hardcoded users address from saviynt to target application using REST connector and we tried using below JSON but didn't work, please suggest if you have any other way to achieve it.

\"default-address\":{\"street1\":\"${if(user?.location=='Full-Time Remote' or user?.location=='Remote' or user?.location=='Permanent Teleworker'){'[30 Winter Street]'}else {user?.street}}\",\"city\":\"${if(user?.location=='Full-Time Remote' or user?.location=='Remote' or user?.location=='Permanent Teleworker'){'[Boston]'}else {user?.city}}\",\"state\":\"${if(user?.location=='Full-Time Remote' or user?.location=='Remote' or user?.location=='Permanent Teleworker'){'[Massachusetts]'}else {user?.state}}\",\"postal-code\":\"${if(user?.location=='Full-Time Remote' or user?.location=='Remote' or user?.location=='Permanent Teleworker'){'[02108]'}else {user?.regioncode}}\",\"country\":{\"code\":\"${user?.country}\"}}

Regards,

Chandan Gowda

7 REPLIES 7

indra_hema_95
Regular Contributor III
Regular Contributor III

Hi @cgowda do you see any error in the logs?

Regards,

Indra

indra_hema_95
Regular Contributor III
Regular Contributor III

Hi @cgowda try this

"{\"default-address\":{\"street1\":\"${if (user?.location=='Full-Time Remote' or user?.location=='Remote' or user?.location=='Permanent Teleworker'){'[30 Winter Street]'} else {user?.street}}\",\"city\":\"${if (user?.location=='Full-Time Remote' or user?.location=='Remote' or user?.location=='Permanent Teleworker'){'[Boston]'} else {user?.city}}\",\"state\":\"${if (user?.location=='Full-Time Remote' or user?.location=='Remote' or user?.location=='Permanent Teleworker'){'[Massachusetts]'} else {user?.state}}\",\"postal-code\":\"${if (user?.location=='Full-Time Remote' or user?.location=='Remote' or user?.location=='Permanent Teleworker'){'[02108]'} else {user?.regioncode}}\",\"country\":{\"code\":\"${user?.country}\"}}}"

Regards,

Indra

SumathiSomala
All-Star
All-Star

@cgowda Use || instead or 

Try below samples

\"default-address\":{\"street1\":\"${if(user?.location=='Full-Time Remote' || user?.location=='Remote' || user?.location=='Permanent Teleworker'){'[30 Winter Street]'}else {user?.street}}\",\"city\":\"${if(user?.location=='Full-Time Remote' || user?.location=='Remote' || user?.location=='Permanent Teleworker'){'[Boston]'}else {user?.city}}\",\"state\":\"${if(user?.location=='Full-Time Remote' || user?.location=='Remote' || user?.location=='Permanent Teleworker'){'[Massachusetts]'}else {user?.state}}\",\"postal-code\":\"${if(user?.location=='Full-Time Remote' || user?.location=='Remote' || user?.location=='Permanent Teleworker'){'[02108]'}else {user?.regioncode}}\",\"country\":{\"code\":\"${user?.country}\"}}


\"default-address\":{\"street1\":\"${if(user?.location.equals('Full-Time Remote') || user?.location.equals('Remote') || user?.location.equals('Permanent Teleworker')){'[30 Winter Street]'}else {user?.street}}\",\"city\":\"${if(user?.location.equals('Full-Time Remote')|| user?.location.equals('Remote') || user?.location.equals('Permanent Teleworker')){'[Boston]'}else {user?.city}}\",\"state\":\"${if(user?.location.equals('Full-Time Remote') || user?.location.equals('Remote') || user?.location.equals('Permanent Teleworker')){'[Massachusetts]'}else {user?.state}}\",\"postal-code\":\"${if(user?.location.equals('Full-Time Remote')|| user?.location('Remote') || user?.location.equals('Permanent Teleworker')){'[02108]'}else {user?.regioncode}}\",\"country\":{\"code\":\"${user?.country}\"}}

Regards,
Sumathi Somala

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

rushikeshvartak
All-Star
All-Star
{
  "default-address": {
    "street1": "${(user?.location == 'Full-Time Remote' || user?.location == 'Remote' || user?.location == 'Permanent Teleworker') ? '30 Winter Street' : user?.street}",
    "city": "${(user?.location == 'Full-Time Remote' || user?.location == 'Remote' || user?.location == 'Permanent Teleworker') ? 'Boston' : user?.city}",
    "state": "${(user?.location == 'Full-Time Remote' || user?.location == 'Remote' || user?.location == 'Permanent Teleworker') ? 'Massachusetts' : user?.state}",
    "postal-code": "${(user?.location == 'Full-Time Remote' || user?.location == 'Remote' || user?.location == 'Permanent Teleworker') ? '02108' : user?.regioncode}",
    "country": {
      "code": "${user?.country}"
    }
  }
}

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

stalluri
Valued Contributor II
Valued Contributor II

@cgowda 

You can try the below JSON.

{
    "httpParams": "{\"default-address\":{\"street1\":\"${if(user?.location=='Full-Time Remote' || user?.location=='Remote' || user?.location=='Permanent Teleworker'){'[30 Winter Street]'}else {user?.street}}\",\"city\":\"${if(user?.location=='Full-Time Remote' || user?.location=='Remote' || user?.location=='Permanent Teleworker'){'[Boston]'}else {user?.city}}\",\"state\":\"${if(user?.location=='Full-Time Remote' || user?.location=='Remote' || user?.location=='Permanent Teleworker'){'[Massachusetts]'}else {user?.state}}\",\"postal-code\":\"${if(user?.location=='Full-Time Remote' || user?.location=='Remote' || user?.location=='Permanent Teleworker'){'[02108]'}else {user?.regioncode}}\",\"country\":{\"code\":\"${user?.country}\"}}}"
}


Can you also share the Postman Curl and the Error log in the text file.


Best Regards,
Sam Talluri
If you find this a helpful response, kindly consider selecting Accept As Solution and clicking on the kudos button.

Kaustubh
Regular Contributor
Regular Contributor

\"Type of Services\":\"${if(user.customproperty5.equals('AD Onboarding Completed')) {'New hire notification '} else {'Department change '}}\",


Kaustubh Pawar
Saviynt Certified IGA Professional

cgowda
New Contributor III
New Contributor III

Thank You, @SumathiSomala @rushikeshvartak much appreciated