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

Update user task are completing but updates are not pushed to user

saimeghana
Regular Contributor II
Regular Contributor II

Hi Team,

We are using sav4savrest connector to update the displayname attribute and we have preprocessor query and updateuserjson

we created the updateuser task and those tasks are completed but updates are not pushed to user.

We are using below updateuserjson

"httpParams": "{\"username\":\"${user?.username}\",\"displayname\":\"${if(user?.employeetype=='Permanent Employee' && user?.entity is null){firstname+''+lastname}else if(user?.employeetype=='Permanent Employee' && user?.customproperty3='89' && user?.entity is null){firstname+''+lastname+'External'}else if(user?.employeetype=='Permanent Employee' && user?.entity is null){firstname+''+lastname+'Externe'}}\"}",

Please help us on this issue.

Thanks,

Sai Meghana

14 REPLIES 14

rushikeshvartak
All-Star
All-Star

Please share full json

 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Hi Rushikeshvartak,

Please find the below json

{
"actions": {
"Update Login": {
"call": [
{
"name": "updateusercp",
"connection": "userAuth",
"url": "https://abc.saviyntcloud.com/ECM/api/v5/updateUser",
"httpMethod": "POST",
"httpContentType": "application/json",
"httpParams": "{\"username\":\"${user?.username}\",\"displayname\":\"${if(user?.employeetype=='Permanent Employee' && user?.entity is null){firstname+''+lastname}else if(user?.employeetype=='Permanent Employee' && user?.customproperty3='89' && user?.entity is null){firstname+''+lastname+'External'}else if(user?.employeetype=='Permanent Employee' && user?.entity is null){firstname+''+lastname+'Externe'}}\"}",
"httpHeaders": {
"Authorization": "${access_token}",
"Content-Type": "application/json"
},
"successResponses": {
"message": "User Updated Successfully",
"statusCode": "200,201"
}
}
]
}
}
}

Thanks,

Sai Meghana

{
"actions": {
"Update Login": {
"call": [
{
"name": "Update Login",
"connection": "userAuth",
"url": "https://abc.saviyntcloud.com/ECM/api/v5/updateUser",
"httpMethod": "POST",
"httpContentType": "application/json",
"httpParams": "{\"username\":\"${user?.username}\",\"displayname\":\"${if(user?.employeetype=='Permanent Employee' && user?.entity is null){firstname+''+lastname}else if(user?.employeetype=='Permanent Employee' && user?.customproperty3='89' && user?.entity is null){firstname+''+lastname+'External'}else if(user?.employeetype=='Permanent Employee' && user?.entity is null){firstname+''+lastname+'Externe'}}\"}",
"httpHeaders": {
"Authorization": "${access_token}",
"Content-Type": "application/json"
},
"successResponses": {
"message": "User Updated Successfully",
"statusCode": "200,201"
}
}
]
}
}
}


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Tried with these json, still it's not updating in user

Enable additional logs and validate parameters getting sent 

showlogs - true in configjson


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Added the config json and tried, in Logs we ca see all the attributes are passing and we don't see any error in logs.

Hi,

We tried and fetched the logs we didn't see any error in logs.

Please can we have some update on this issue.

Thanks,

Sai Meghana

Varshi_Balaji
Regular Contributor
Regular Contributor

Hi @rushikeshvartak .

Thank you for the support, the above issue is resolved. There was a bracket missing and we added. it is working now.

We need to add "AND" condition.we tried '&&','&',and,AND. but it is not working.

do you have any example how to use and condition in if else.

Eg: "httpParams": "{\"username\":\"${user?.username}\",\"displayname\":\"${if(user?.employeetype=='Permanent Employee' and user?.customproperty3=='89'){user?.firstname+' '+user?.lastname}else{'test'}}\"}",

Regards,

Varshitha

Hi @Varshi_Balaji ,

Can you try the below:

${'Permanent Employee'.equals(user?.employeeType) && user.customproperty3=='89' ? [{user?firstname + user?lastname}] : [{'Test'}]}

 

If this helps your question, please consider selecting Accept as Solution and hit Kudos

"httpParams": "{\"username\":\"${user?.username}\",\"displayname\":\"${(user?.employeetype == 'Permanent Employee' && user?.customproperty3 == '89') ? user?.firstname + ' ' + user?.lastname : 'test'}\"}",


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Varshi_Balaji
Regular Contributor
Regular Contributor

Hi @rushikeshvartak .

The solution is working. Thank you for the support.

We need to add multiple conditions in the ternary operator. But it is not working.

"httpParams": "{\"username\":\"${user?.username}\",\"displayname\":\"${(user?.employeeType == 'Permanent Employee' && user?.entity==null) ? user?.firstname + ' ' + user?.lastname : (user?.employeeType!='Permanent Employee' && user?.customproperty3='89') ? user?.firstname+' '+user?.lastname : 'test'}\"}",

- This is the condition I added.The condition in bold is not working. and if I'm adding only one condition like (user?.employeeType!='Permanent Employee') ? user?.firstname - this is working.

Can you please help us here to add multiple condition and can you suggest me if I'm adding the syntax in incorrect way.

Regards,

Varshitha

"httpParams": "{\"username\":\"${user?.username}\",\"displayname\":\"${(user?.employeeType == 'Permanent Employee' && user?.entity == null) ? user?.firstname + ' ' + user?.lastname : (user?.employeeType != 'Permanent Employee' && user?.customproperty3 == '89') ? user?.firstname + ' ' + user?.lastname : 'test'}\"}"


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Varshi_Balaji
Regular Contributor
Regular Contributor

Yes,Updated in the same format and it is working.

Regards,

Varshitha

Varshitha

Please click the 'Accept As Solution' button on the reply (or replies) that best answered your original question.


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.