and more in a single search tool across platforms. Read the announcement here. |
04/11/2024 10:05 AM
Hi Team,
We have a requirement where we need to update username based on employeeid.
This is the logic: "httpParams": "{\"updatedusername\":\"${user?.customproperty65}\",\"employeeid\":\"${user?.employeeid}\",\"propertytosearch\":\"employeeid\"}",
But for our requirement some users have employeeid as null,so we need to check other cp24.So I have added if else condition in property to search
"httpParams": "{\"updatedusername\":\"${user?.customproperty65}\",\"propertytosearch\":\"${(user?.employeeid == null) ? user?.customproperty24 : user?.employeeid}\",\"employeeid\":\"${user?.employeeid}\",\"customproperty24\":\"${user?.customproperty24}\"}",
This is not working and username is not updating if employeeid is null and cp24 has value.
Can you please suggest any other methos where w can achieve this.
Regards,
Varshitha
Solved! Go to Solution.
04/11/2024 10:37 AM
Hi @Varshi_Balaji,
In order to help you troubleshoot, are you using Saviynt4Saviynt Rest connector to update the identity's username in Saviynt ?
Note that in your second JSON, you're indicating in propertytosearch the following :
${(user?.employeeid == null) ? user?.customproperty24 : user?.employeeid}
This means that "If employeeid is null, then use the identity's customproperty24. Else use the identity's employeeid".
However, propertytosearch expects to have the column name to use for searching the user to update.
Therefore, I suggest you to use the below :
${(user?.employeeid == null) ? 'customproperty24' : 'employeeid'}
Hope this helps !
04/11/2024 10:48 AM - edited 04/11/2024 10:49 AM
Hi Adrien,
Please find the attached update user json
{
"actions": {
"Update Login": {
"call": [
{
"name": "updateusercp",
"connection": "userAuth",
"url": "https://test.saviyntcloud.com/ECM/api/v5/updateUser",
"httpMethod": "POST",
"httpContentType": "application/json",
"httpParams": "{\"updatedusername\":\"${user?.customproperty65}\",\"propertytosearch\":\"${(user?.employeeid == null) ? 'customproperty24' : 'employeeid'}\",\"employeeid\":\"${user?.employeeid}\",\"customproperty24\":\"${user?.customproperty24}\"}",
"httpHeaders": {
"Authorization": "${access_token}",
"Content-Type": "application/json"
},
"successResponses":
{
"message": "User Updated Successfully",
"statusCode": "200,201"
}
}
]
}
}
}
I tried the above condition but it is not working, username did not update.
Regards,
Varshitha
04/11/2024 11:00 AM
Hi @Varshi_Balaji,
I did try through Postman and was able to perform successful changes on the identity's Username using the below JSON sample data
{
"propertytosearch": "customproperty24",
"updatedusername": "NewUsername1",
"customproperty24" : "sampleValue"
}
Any chance you can let me know the following :
04/11/2024 11:11 AM
Hi Adrien,
I tested again and above logic works. Thank you for the support.
Regards,
Varshitha
04/11/2024 11:12 AM
Happy this helped resolved your case !
Drop a Kudo if you have time 😉