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

Date format change while import

hareeshreddy
New Contributor III
New Contributor III

Hi,

I am facing an issue with the date format while importing user start and end date through Rest API from darwinbox application.

present date format reflecting in saviynt is as MM-DD-YYYY while importing date through Rest API

Userimport:

"date_of_joining": "11-16-2021".

But i want DD-MM-YYYY format to be reflected with the imported date.

 

How can we achieve this please suggest me.

 

Regards,

Harish

 

4 REPLIES 4

RakeshMG
Saviynt Employee
Saviynt Employee

Please try 

${if(user.startdate!=null){new java.text.SimpleDateFormat('YYYY-MM-dd').format(user.startdate)}else{''}

 

Refer to following forum post : https://forums.saviynt.com/t5/identity-governance/need-to-modify-the-format-of-the-attribute-user-en...


​Regards

Rakesh M Goudar

hareeshreddy
New Contributor III
New Contributor III

Hi @RakeshMG Thanks for the reply.

Where do i need to place the provided

${if(user.startdate!=null){new java.text.SimpleDateFormat('YYYY-MM-dd').format(user.startdate)}else{''}exactly

In Rest connector import user parameter.

"colsToPropsMap": {
"firstname":"first_name~#~char",
"lastname":"last_name~#~char",

"startdate":"date_of_joining~#~epochdate"

}

hareeshreddy_0-1680512644301.png

 

 

RakeshMG
Saviynt Employee
Saviynt Employee

Please refer to following document 
https://docs.saviyntcloud.com/bundle/REST-v23x/page/Content/Developers-Handbook.htm

In which you can use #CONST#

Sample to use #CONST# :

"email": "#CONST#${List responseList = response.empInfo.personNav.emailNav.results; int count = 0; int size = responseList.size(); Iterator iterator = responseList.iterator(); while (iterator.hasNext()){count++; Map dataMap = iterator.next(); if('312'.equals(dataMap.emailType)){return dataMap.emailAddress}else if(count == size){return null}}}~#~char"

So you can try as following :

"startdate":"#CONST#$xxxxxx


​Regards

Rakesh M Goudar

hareeshreddy
New Contributor III
New Contributor III

Hi @RakeshMG ,

I have followed same as you suggested after referring to the https://docs.saviyntcloud.com/bundle/REST-v23x/page/Content/Developers-Handbook.htm

i have given below

"colsToPropsMap": {

"state": "office_state~#~char",
"startdate":"#CONST#${List responseList = response.empInfo.personNav.emailNav.results; int count = 0; int size = responseList.size(); Iterator iterator = responseList.iterator(); while (iterator.hasNext()){count++; Map dataMap = iterator.next(); if('312'.equals(dataMap.emailType)){return dataMap.emailAddress}else if(count == size){return null}}}~#~char",

}

 

But i did not get connection success, syntax error.

also i tried with this

{

   "globalSettings": {

    "dateFormat": "yyyy-MM-dd"

  }

But date format is not changed s expected.

Any other successfull solution is existed to sort it.

 

Regards,

Hareesh K