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

Issue in update user json.

saimeghana
Regular Contributor II
Regular Contributor II

Hi Team,

We are using the update user json in Rest connector to update the Username, we added the below query to copy the cp65 value to username attribute in saviynt by checking the employeeid and systemusername condition.

We are using the user update rules to call the connection and it will create the update user task, once that task completes it will update the username.

Issue: The Provisioning job is completing the update user task to update the username, but it is updating the employeeid along with username to "null".

Query: 

{\"updatedusername\":\"${user?.customproperty65}\",\"propertytosearch\":\"${(user?.entity =='WW SuccessFactors') ? 'systemUserName' : 'employeeid'}\",\"employeeid\":\"${if(user?.employeeid!=null){user?.employeeid} else {}}\",\"systemUserName\":\"${if(user?.systemUserName!=null){user?.systemUserName} else {}}\"}"

we tried with different else condition still it is updating null in employeeid.

1) else null, -- pushing Null

2) else {}, -- pushing Null

3) else {null} -- pushing Null

Please could you help us on this issue asap.

 

Thanks,

Sai Meghana

 

5 REPLIES 5

NM
Esteemed Contributor
Esteemed Contributor

Hi @saimeghana , why are you passing employee id field?? If ideally only username update is required?


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

saimeghana
Regular Contributor II
Regular Contributor II

Those 2 fields are unique attributes, so to differentiate the type of users we used the employeeid and systemusername fields.

rushikeshvartak
All-Star
All-Star

What is stored in cp65 ?


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

cp65 will have the username, we are copying the cp65 to username

Amit_Malik
Valued Contributor II
Valued Contributor II

Hi @saimeghana ,

have you tried it this way, don't construct the param when values are null.

{\"propertytosearch\":\"${(user?.entity =='WW SuccessFactors') ? 'systemUserName' : 'employeeid'}\" ${if(user?.customproperty65 != null){',\"updatedusername\":\"'+user?.customproperty65+'\"'} else {''}} ${if(user?.employeeid != null){',\"employeeid\":\"'+user?.employeeid+'\"'} else {''}}}"

You can extend this to contrute REST of your JSON, but the main part is , you don't construct {"username" : "cp65"} if cp65 doesn't exist. This method will create a JSON output like :

Case 1 : if cp65 is null and employeeID is not null.

{\"propertytosearch\":"employeeid", "employeeid":\"employeeid\":\"'+user?.employeeid+'\"}

Case 2 : if cp65 and employeeID both not null thn

{\"propertytosearch\":"employeeid",\"updatedusername\":\"'+user?.customproperty65+'\", "employeeid":\"employeeid\":\"'+user?.employeeid+'\"}

Case 3 both null

{\"propertytosearch\":"employeeid"}

This will only include the key - value pair if the value/condition is not null.

 

Thanks,

Amit

Kind Regards,
Amit Malik
If this helped you move forward, please click on the "Kudos" button.
If this answers your query, please select "Accept As Solution".