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

enddate is not set when status is "I"

Roua
Regular Contributor
Regular Contributor

i am trying to set the end date on user side but although i have it in modify user json like this: 

  "UPDATE NEWUSERDATA NU SET NU.enddate = CASE WHEN NU.customproperty5 = 'I' THEN CURDATE() ELSE NU.enddate END",

in user import json: 
"enddate": "d:Exitdate~#~char",
it doesn't work when i run the import user job or the update user job 
i also tried : 

 

 

"UPDATE NEWUSERDATA NU SET NU.enddate = CASE WHEN NU.customproperty5 = 'I' THEN DATE_FORMAT(NU.enddate, '%m/%d/%Y') ELSE NU.enddate END",

 

 

full MODIFYUSERDATAJSON: 

Spoiler
{
"ADDITIONALTABLES": {
"USERS": "SELECT customproperty2, customproperty11, customproperty9, lastname, firstname, departmentname, employeeType, Orgunitid, customproperty40, country, statuskey, customproperty5, username, startdate, enddate, customproperty3, manager, customproperty14, customproperty21, userkey, customproperty13, customer, secondaryManager, owneronterminate, customproperty30, owner FROM USERS",
"CUSTOMER": "SELECT customername FROM customer"
},
"COMPUTEDCOLUMNS": [
"customproperty2",
"customproperty11",
"customproperty9",
"displayname",
"Orgunitid",
"username",
"statuskey",
"startdate",
"customer",
"enddate",
"statuskey",
"manager",
"customproperty3",
"customproperty14",
"customproperty15",
"customproperty13",
"secondaryManager",
"userkey",
"owneronterminate",
"customproperty30"
],
"PREPROCESSQUERIES": [
"UPDATE NEWUSERDATA NU SET NU.customproperty2 = DATE_FORMAT(STR_TO_DATE(NU.customproperty2, '%Y%m%d'), '%d.%m.%Y')",
"UPDATE NEWUSERDATA NU SET NU.customproperty11 = CASE WHEN NU.customproperty11 = '00000000' THEN NULL ELSE DATE_FORMAT(STR_TO_DATE(NU.customproperty11, '%Y%m%d'), '%d.%m.%Y') END",
"UPDATE NEWUSERDATA NU SET NU.customproperty9 = CASE WHEN NU.customproperty9 = '00000000' THEN NULL ELSE NU.customproperty9 END",
"UPDATE NEWUSERDATA NU SET NU.displayname = CONCAT(UPPER(NU.lastname), ' ', NU.firstname, ' (', NU.departmentname, IF(NU.employeeType = 'E', ' (EXT)', ''), ')') WHERE NU.departmentname IS NOT NULL",
"UPDATE NEWUSERDATA NU SET NU.Orgunitid = CONCAT(NU.customproperty40, '-', NU.Orgunitid, '')",
"UPDATE NEWUSERDATA NU SET NU.username = CONCAT(NU.country, NU.username) WHERE NU.username NOT LIKE CONCAT(NU.country, '%')",
"UPDATE NEWUSERDATA NU SET NU.manager = CONCAT(NU.country, NU.manager)",
"UPDATE NEWUSERDATA NU SET NU.customproperty30 = CONCAT(NU.country, NU.customproperty30)",
"UPDATE NEWUSERDATA NU SET NU.secondaryManager = NU.customproperty30",
"UPDATE NEWUSERDATA NU SET NU.statuskey = CASE WHEN NU.customproperty5 IN ('P', 'A') THEN 1 WHEN NU.customproperty5 = 'I' THEN 0 END",
"UPDATE NEWUSERDATA NU SET NU.startdate = DATE_FORMAT(STR_TO_DATE(NU.startdate, '%Y%m%d'), '%b %d, %Y')",
"UPDATE NEWUSERDATA NU SET NU.enddate = CASE WHEN NU.customproperty5 = 'I' THEN DATE_FORMAT(NU.enddate, '%m/%d/%Y') ELSE NU.enddate END",
"UPDATE NEWUSERDATA NU SET NU.customproperty3 = NU.username",
"UPDATE NEWUSERDATA NU SET NU.customer = (SELECT customername FROM customer WHERE customer.CUSTOMERCODE = NU.Orgunitid)",
"UPDATE NEWUSERDATA NU SET NU.OWNERONTERMINATE = CASE WHEN NU.manager IS NOT NULL THEN NU.manager ELSE '' END",
"UPDATE NEWUSERDATA NU SET NU.customproperty14 = CASE WHEN NU.customproperty15 = '50404368' THEN 'Poolberater' WHEN NU.customproperty15 = '50404373' THEN 'Projektberater' WHEN NU.customproperty15 = '50404374' THEN 'Fachberater' ELSE NULL END",
"UPDATE NEWUSERDATA NU SET NU.customproperty13 = CONCAT(NU.customproperty13)"
]
}



any ideas ? thank you !

8 REPLIES 8

rushikeshvartak
All-Star
All-Star

Share sample value from API response for Exitdate


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

indra_hema_95
Regular Contributor III
Regular Contributor III

Hi @Roua in user import JSON you able to fetch the value for enddate with this mapping "enddate": "d:Exitdate~#~char" ? without having enddate in preprocessor?

Regards,

Indra

Roua
Regular Contributor
Regular Contributor

i am sorry, i am not sure for now, bur before we could yes.. i can't tell now in the target system which ones already have an enddate since they are facing some troubles with the perID and i can't fetch he data currently to look it up 

Date is invalid in response 000000 is invalid date


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

Roua
Regular Contributor
Regular Contributor

this is how it is set in target system and as an example we can look at the start date: 
d:Entrydate>19960812</d:Entrydate>

Roua_0-1725373052532.png

 

 

Roua
Regular Contributor
Regular Contributor

@rushikeshvartak 

<d:Entrydate>19960812</d:Entrydate>
<d:Exitdate>00000000</d:Exitdate>

Roua_0-1725372275037.png

 



stalluri
Valued Contributor II
Valued Contributor II

@Roua 
Can you please share the Sample response for single user.


Best Regards,
Sam Talluri
If you find this a helpful response, kindly consider selecting Accept As Solution and clicking on the kudos button.

Roua
Regular Contributor
Regular Contributor

you mean what would the expected date be? 
<d:Entrydate>19960812</d:Entrydate>
<d:Exitdate>00000000</d:Exitdate>

Roua_0-1725373192313.png