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

Custom date format in create & update account json

AG
Regular Contributor II
Regular Contributor II

I have a requirement to convert a Dynamic DATE type attribute say 'activedate' to 'mm/dd/yy' format and pass it to the target. I have used activedate.format('mm/dd/yy') but that is not working.

12 REPLIES 12

rushikeshvartak
All-Star
All-Star

Please specify connector


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

AG
Regular Contributor II
Regular Contributor II

AD/LDAP

 ${Calendar.getInstance().getTime().format('yyyyMMddHHmmss')}Z 


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

AG
Regular Contributor II
Regular Contributor II

I saw that in forum , but does not work ...how am I suppose to use that to convert the dynamic attribute value . dynamic attribute is "activedate"

Date.parse('mm/dd/yyyy', activedate)


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

AG
Regular Contributor II
Regular Contributor II

So, I am using as below

"activedate":"${Date.parse('mm/dd/yy', activedate)}",

Got error - java.text.ParseException: Unparseable date: "Jan 11,2024"

${Date.parse('MMM dd, yyyy', activedate)}",


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

AG
Regular Contributor II
Regular Contributor II

date must be transformed to 'mm/dd/yy'

${Date.parse('MMM dd, yyyy', activedate).format('MM/dd/yy')}


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

AG
Regular Contributor II
Regular Contributor II

Thanks, still same parsing error.

From logs Binding map is.. [ active:Jan 15,2024 ] then the error java.text.ParseException: Unparseable date: "Jan 15,2024" at java.text.DateFormat.parse(DateFormat.java:366) at SimpleTemplateScript7089.run(SimpleTemplateScript7089.groovy:17)

 

@rushikeshvartak  - the format provided worked, I had to remove extra space to match the value in the binding.

${Date.parse('MMM dd,yyyy', activedate).format('MM/dd/yy')}

Manu269
All-Star
All-Star

@AG can you refer this article :

new Date() function not working in JSON - Saviynt Forums - 20835

AD Connector set account expires and logon denied ... - Saviynt Forums - 24696

Regards
Manish Kumar
If the response answered your query, please Accept As Solution and Kudos
.

AG
Regular Contributor II
Regular Contributor II

Do you know if Saviynt supports this requirement?

[This message has been edited by moderator to remove @ mention to other forum member or employee who is not part of this post]