Click HERE to see how Saviynt Intelligence is transforming the industry. |
09/16/2024 03:06 AM
hello team,
on a Sav4Sav connection, i'm using the preprocessor to update CP2,
Clarification: these are users with an inactive status (do we agree that we can update users with an inactive status?).
I want to test a new rule and I have modified my preprocessor as follows:
{
"ADDITIONALTABLES": {
"USERS": "SELECT USERNAME, STATUSKEY, ENDDATE, CUSTOMPROPERTY2 FROM USERS"
},
"TABLEINDEXES": {
"CURRENTUSERS": [
"USERNAME",
"STATUSKEY",
"CUSTOMPROPERTY2"
]
},
"COMPUTEDCOLUMNS": [
"statuskey",
"customproperty2",
"endDate"
],
"PREPROCESSQUERIES": [
"UPDATE NEWUSERDATA LEFT JOIN CURRENTUSERS ON NEWUSERDATA.USERNAME = CURRENTUSERS.USERNAME SET NEWUSERDATA.endDate = CASE WHEN NEWUSERDATA.endDate LIKE 'null' THEN NULL ELSE NEWUSERDATA.endDate END",
"UPDATE NEWUSERDATA LEFT JOIN CURRENTUSERS ON NEWUSERDATA.USERNAME = CURRENTUSERS.USERNAME SET NEWUSERDATA.customproperty2 = CASE WHEN CURRENTUSERS.endDate IS NOT NULL AND CURRENTUSERS.endDate <= NOW() AND NEWUSERDATA.customproperty2 IS NULL THEN 'LeaveTESTACTIVE2' ELSE NEWUSERDATA.customproperty2 END;"
]
}
However, none of my users that should be updated are.
I've tried this request too :
"UPDATE NEWUSERDATA LEFT JOIN CURRENTUSERS ON NEWUSERDATA.USERNAME = CURRENTUSERS.USERNAME SET NEWUSERDATA.customproperty2 = CASE WHEN CURRENTUSERS.endDate IS NOT NULL AND CURRENTUSERS.endDate <= NOW() AND NEWUSERDATA.customproperty2 IS NULL THEN 'LeaveTESTACTIVE2' ELSE NEWUSERDATA.customproperty2 END;",
"UPDATE NEWUSERDATA LEFT JOIN CURRENTUSERS ON NEWUSERDATA.USERNAME = CURRENTUSERS.USERNAME SET NEWUSERDATA.customproperty2 = CASE WHEN NEWUSERDATA.endDate IS NOT NULL AND NEWUSERDATA.endDate <= NOW() AND NEWUSERDATA.customproperty2 IS NULL THEN 'LeaveTESTACTIVE2' ELSE NEWUSERDATA.customproperty2 END;"
To see if it will change , But nothing changes,
could you please help me tu Update user
Solved! Go to Solution.
09/16/2024 03:29 AM
Hi @Yeya , I can try one thing .. try removing the end date for a test user and try to update the cp2.. most likely if end date is present it is not able to update.
09/16/2024 05:00 AM
Hi @NM
thank you for your answer,
here are a few more details about our use case:
we import our future employees from our HRIS, which also gives us the contract end date and the contract start date.
Users with a start date higher than the current date are inactive.
my intention was to have the start date checked every day,
and that when the preprocessor detects that the start date is equal to the current date,
update a CP which is itself monitored by a User Update Rule which takes the action “enable user”.
Following your answer, wouldn't this work?
Thank you in advance for your reply.
09/16/2024 05:43 AM
Hi @Yeya case is are those users coming in from HRIS
So a user was created today but it start day is 7 days after . If on the startday no record is coming for that user we won't be able to update cp2 value.
Are you running an incremental import?
09/16/2024 06:14 AM
Hi @NM
Thank for your answer,
if I understand correctly, it's absolutely necessary to have an update or new data from our HRIS for this to work?
isn't it possible to carry out this use case in another way (with analytics, for example, or another solution if you have one)?
we use a full import.
09/16/2024 06:50 AM
@Yeya if using full import them shouldn't be an issue .
Can you try one thing try updating the cp2 with the a static value just to see if it is populating the field.
09/16/2024 06:55 AM