09/05/2023 11:49 AM
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?
09/07/2023 11:56 AM
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