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 in SAV4SAV REST Connection to Update Owneronterminate Attribute

Sanjeevini
New Contributor III
New Contributor III

Hi Team,

Can we update the 'Owneronterminate' user attribute with 'Manager' value present on user profile using UpdateUserJSON of SAV4SAV REST connector type?

If yes, could you please share the sample JSON here?

Thanks,

8 REPLIES 8

rushikeshvartak
All-Star
All-Star

{
"updateUserQry": [
"update users set owneronterminate=(select case when (owneronterminate!=manager OR owneronterminate is NULL or owneronterminate='') then manager else owneronterminate end) where userkey = ${user.id}"
]
}


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

Hi, shared query is not working, task is processing successfully where Owneronterminate field is not getting updated. 

Also, Json format is different for REST based Sav4Sav.

Sanjeevini_3-1693297409873.png
Sanjeevini_2-1693297386805.png

Olesia
Regular Contributor
Regular Contributor

Hi @Sanjeevini, were you able to achieve the needed? We are also interested in an example query for UpdateUserJSON in SAV4SAV Rest connector.

Please find below a sample JSON.

{
	"actions": {
		"Update Login": {
			"call": [
				{
					"name": "updateusercp",
					"connection": "userAuth",
					"url": "https://<<TENANT-URL>>/ECM/api/v5/updateUser",
					"httpMethod": "POST",
					"httpContentType": "application/json",
					"httpParams": "{\"username\": \"${user?.username}\",\"customproperty12\": \"Updating\"}",
					"httpHeaders": {
						"Authorization": "${access_token}",
						"Content-Type": "application/json"
					},
					"successResponses": {
						"message": "User Updated Successfully",
						"statusCode": "200,201"
					}
				}
			]
		}
	}
}

 

Thanks,
Amit

Hi @amit_krishnajit

thank you for the provided example. Could you please share an example of SQL queries embedded into the JSON? 

For example, how to use the below query in the SAV4SAV REST Connection?

UPDATE users u

SET u.customproperty7 CASE

                          WHEN EXISTS

                                 (SELECT 1

                                  FROM users

                                  WHERE employeeclass = 'Production Employee'

                                    AND statuskey = '1'

                                    AND manager = u.userkey) THEN 'Y'

                          ELSE 'N'

                      END;

I don't think you can do a SQL query in the provisioning JSONs of REST connector. What is your requirement?

 

Thanks,
Amit

Sanjeevini
New Contributor III
New Contributor III

Hi, 

Have a follow-up question on this thread, can we have an if-else condition in SAV4SAV REST Connection? if yes, could you please share the sample JSON? 

Thanks,

Yes, you can. 

${'Emp'.equals(user?.employeeType) ? 'DWD00L91' : 'CCD00K92'}

 

Thanks,
Amit