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

Check user old data and new data in Preprocessor query

ssharma0-7
New Contributor II
New Contributor II

We have use case where we want to check and compare the old data and new data of an attribute of user in Preprocessor Query.

Ex- suppose user department name got updated in the user import. we want to check the  old data and compare it with new data and based on that we want to update the user Custom property value.

Is there any way we can check this in Modify user data JSON Preprocessor query?

1 REPLY 1

prasannta
Saviynt Employee
Saviynt Employee

Hi @ssharma0-7 

You can try building a query by referring currentusers table. Please find a sample below. You can modify the query to add condition as per your requirement.

UPDATE NEWUSERDATA LEFT JOIN CURRENTUSERS ON NEWUSERDATA.USERNAME = CURRENTUSERS.USERNAME
SET NEWUSERDATA.department =
case WHEN (CURRENTUSERS.department = '<<VALUE1>>') THEN CURRENTUSERS.department WHEN (CURRENTUSERS.department = '<<VALUE2>>') THEN NEWUSERDATA.department end

Thanks