Click HERE to see how Saviynt Intelligence is transforming the industry. |
02/21/2024 12:50 PM
Hello, I'm on version 23.12 and running into an issue when importing accounts who do not have a LASTLOGONDATE. Each time I try to get it to return null, it is trying to insert the string literal 'null' into the database, causing the error:
Data truncation: Incorrect datetime value: 'null' for column 'LASTLOGONDATE' at row 1
I am inserting the Datetime as ~#~char instead of ~#~date. When I used ~#~date I've tried returning a Date object and a String object. Each time, there are no errors but also no dates show in any accounts. Using ~#~char works fine for those entries that do have dates.
I've performed many variations, but here are my recent attempts to get null written instead of 'null':
# Attempt 1:
"lastlogondate": "#CONST#${if(response.LAST_LOGIN_DATE){return Date.parse(\"yyyy-MM-dd'T'HH:mm:ss'Z'\",response.LAST_LOGIN_DATE).format('yyyy-MM-dd HH:mm:ss');}else{return null};}~#~char"
# Attempt 2:
"lastlogondate": "#CONST#${if(response.LAST_LOGIN_DATE){return Date.parse(\"yyyy-MM-dd'T'HH:mm:ss'Z'\",response.LAST_LOGIN_DATE).format('yyyy-MM-dd HH:mm:ss');}else{return};}~#~char"
# Attempt 3:
"lastlogondate": "#CONST#${String dateString; if(response.LAST_LOGIN_DATE){dateString= Date.parse(\"yyyy-MM-dd'T'HH:mm:ss'Z'\",response.LAST_LOGIN_DATE).format('yyyy-MM-dd HH:mm:ss');};return dateString;}~#~char"
Any help is appreciated.
02/21/2024 02:04 PM
Whats date format from target
03/01/2024 08:09 AM
The date format in the response is: