Click HERE to see how Saviynt Intelligence is transforming the industry. |
05/31/2024 08:10 AM
Hi All,
We are importing users via a REST connector. As part of the user import we are getting a date field in the format YYYYMMDD and this is mapped to a user customproperty. We the format of the date to be YYYY-MM-DD.
I have tried various combinations however it has not worked so far. Please share how date can be formatted while importing users.
configurations tried so far :
1. "globalSettings": {
"dateFormat": "yyyy-MM-dd"
}
2. "customproperty16":"${new java.text.SimpleDateFormat('yyyy-MM-dd').format(response.date)}~#~date"
3. "customproperty16":"${new Date(response.date).format('yyyy-MM-dd')}~#~date" } }
Regards,
Krishna Gupta
05/31/2024 08:41 AM
Hi @KrishnaGupta ,
${Date.parse('yyyyMMdd',response.date).format('yyyy-MM-dd')}
Refer article: Re: how to convert string into date in AD and Rest... - Saviynt Forums - 96297
If this helps, please select Accept As Solution and hit Kudos
06/02/2024 11:33 PM - edited 06/02/2024 11:34 PM
This format also didn't work
${Date.parse('yyyyMMdd',response.date).format('yyyy-MM-dd')}
05/31/2024 08:43 AM
@KrishnaGupta please check below article :
06/02/2024 07:48 PM
I have already tried this solution by adding the format in global settings and updating the type to date.
However it doesn't work, probably because the article is regarding account import and the requirement is is to update date format from trusted source during user import.
05/31/2024 09:36 AM
"customproperty30": "#CONST#${new Date(Calendar.getInstance().getTimeInMillis()).format('yyyy-MM-dd hh:mm:ss')}~#~char",
06/02/2024 07:45 PM
This would give the current date, however the requirement is to update date format from trusted source.
06/03/2024 10:55 AM
"customproperty30": "#CONST#${new Date(response.date.time).format('yyyy-MM-dd hh:mm:ss')}~#~char",
06/02/2024 08:58 PM
@KrishnaGupta check this post :
Solved: Converting Date Format in Rest Connector Account I... - Saviynt Forums - 81520
06/02/2024 11:32 PM
Adding date format in global settings in the JSON didn't work.
06/03/2024 04:41 AM
I tried this as well:
"customproperty16": "#CONST#${SimpleDateFormat simpleformat = new SimpleDateFormat(\"yyyy-MM-dd\"); return simpleformat.format(response.date)}~#~char"
What ends up happening is that the value of customproperty16 will end up being this:
#CONST#${SimpleDateFormat simpleformat = new SimpleDateFormat(\"yyyy-MM-dd\"); return simpleformat.format(response.date)}
06/03/2024 06:22 AM
@KrishnaGupta try
"customproperty30": "#CONST#${new java.text.SimpleDateFormat('yyyy-MM-dd').format(new Date(response.date))}~#~date"