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

UpdateUserJSON not working as espected

ayane_ahmed
New Contributor II
New Contributor II

Hello,

We have a requirement to calculate some user attributes via an update task in a Sav4Sav connection after a user creation. For example for certain attributes, we need to have the same value as the user's manager. We have implemented the UpdateUserJSON as well as the user update rule to trigger the Update User task.

The task is created and provisioned but the attributes are not getting updated and there is nothing present in the logs.

Here is the UpdateUserJSON:

{
    "accountIdPath":"call1.message.id",
    "dateFormat":"yyyy-MM-dd'T'HH:mm:ssXXX",
    "call":[
       {
          "name":"call1",
          "connection":"userAuth",
          "url":"https://XXXX/ECM/api/getUser",
          "httpMethod":"GETWITHBODY",
          "httpParams":"{\"manager\":\"${user.owner}\",\"manager_cp12\":\"${user?.owner?.customproperty12}\"}",
          "httpHeaders":{
             "Authorization":"${access_token}"
          },
          "httpContentType":"application/json",
          "successResponses":{
             "statusCode":[
                200,
                201,
                204,
                205
             ]
          }
       },
       {
          "name":"call2",
          "connection":"userAuth",
          "url":"XXX/ECM/api/updateUser",
          "httpMethod":"POST",
          "httpParams":"{\"username\":\"${user.username\"},\"customproperty13\":\"Test\"},{\"customproperty12\":\"${call1.response.message.userlist[0].customproperty12}\"}",
          "httpHeaders":{
             "Authorization":"${access_token}"
          },
          "httpContentType":"application/json",
          "successResponses":{
             "statusCode":[
                200,
                201,
                204,
                205
             ]
          }
       }
    ]
 }
 
Could you help us ?
Regards,
2 REPLIES 2

rushikeshvartak
All-Star
All-Star

Your syntax is wrong 

Update user needs to have actions defined in json

Sample json

{
"actions": {
"Disable User": {
"call": [
{
"callOrder": 0,
"connection": "${connectionName}",
"httpContentType": "application/json",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpMethod": "PATCH",
"httpParams": "{\"accountEnabled\": false}",
"name": "Disable User",
"successResponses": {
"statusCode": [
200,
204
]
},
"url": "https://graph.microsoft.com/v1.0/users/${user.customproperty4}"
}
]
},
"Enable User": {
"call": [
{
"callOrder": 0,
"connection": "${connectionName}",
"httpContentType": "application/json",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpMethod": "PATCH",
"httpParams": "{\"accountEnabled\": true}",
"name": "Enable User",
"successResponses": {
"statusCode": [
200,
204
]
},
"url": "https://graph.microsoft.com/v1.0/users/${user.customproperty4}"
}
]
},
"Update Login": {
"call": [
{
"callOrder": 0,
"connection": "${connectionName}",
"httpContentType": "application/json",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpMethod": "PATCH",
"httpParams": "{\"mobilePhone\": \"${user.phonenumber}\"}",
"name": "Update Login",
"successResponses": {
"statusCode": [
200,
204
]
},
"url": "https://graph.microsoft.com/v1.0/users/${user.customproperty4}"
}
]
}
}
}

https://docs.saviyntcloud.com/bundle/AzureAD-v24x/page/Content/Configuring-the-Integration-for-Impor...


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

Hello @rushikeshvartak,

But in that case, how do you update the user's attributes via the sav4sav connector ? Because we only need to modify the attributes and not do any action on the user.

Thank you.

Regards,