Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Update User attribut with Sav4Sav connection using preprocessor

Yeya
New Contributor
New Contributor

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

6 REPLIES 6

NM
Honored Contributor II
Honored Contributor II

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.

Yeya
New Contributor
New Contributor

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.

NM
Honored Contributor II
Honored Contributor II

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?

Yeya
New Contributor
New Contributor

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.

NM
Honored Contributor II
Honored Contributor II

@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.

  • You can create analytics report for future dated start date. and use Sav4sav4 REST connector to update user status

Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.