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

ImportUserJSON - set status based on endDate

HarishG
Regular Contributor
Regular Contributor

Hi,

We are trying to update the user status based on endDate, using sav4sav user import. I tried the below line to check if the user’s endDate is in past AND user is active? if yes, update the status to Inactive else leave the status unchanged. But it didn’t work. Any suggestions, how to achieve this?

"statuskey": "#CONST${(DATEDIFF(current_date(),response.enddate) >= 0 and response.statuskey==1)?'false':''}~#~char


"statusConfig": { "active": true, "inactive": false },

 

 

Thanks,

Harish

1 REPLY 1

rushikeshvartak
All-Star
All-Star

Language should be java in const and not mysql.

you can also do same using preprocessor 

const updateUserStatus = (endDate, currentStatus) => currentStatus === 1 && new Date(endDate) < new Date() ? 0 : currentStatus;


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