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

REST Connector - Current Date

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on June 24 2020 at 15:46 UTC

Is there an easy way to send and format current date in a REST connector?

I have successfully used user.startdate in the past with the formatting shown below but it does not seem to work with other attributes.

${new java.text.SimpleDateFormat('yyyy-MM-dd').format(user.startdate)}\


I have also attempted to use the task attribute as a work around but have not had success.

${new java.text.SimpleDateFormat('yyyy-MM-dd').format(task.taskdate)}\


Has anyone had success with sending current date and formatting in a rest call?

This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.
4 REPLIES 4

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on June 24 2020 at 16:19 UTC

Hi Robert,


Below is working example for date variable in REST connector


startDate=${(new Date()).format('yyyy-MM-dd')}

This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on June 25 2020 at 05:16 UTC

Hi Robert,


You can also try the following.

${StatementDate = Calendar.instance; StatementDate.format('dd-MM-yyyy')}

This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on June 26 2020 at 14:44 UTC

Thank you for the suggestions but neither worked in my case. I am using a 5.4 instance of Saviynt and below is an snippet of my JSON.


\"EFFECTIVE START DATE\": \"${new java.text.SimpleDateFormat('yyyy-MM-dd').format(user.startdate)}\", \"EXPIRATION DATE\": \"${user.enddate==null?'':{new java.text.SimpleDateFormat('yyyy-MM-dd').format(user.enddate)}}\", \"USER STATUS\": \"I\",

This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on June 30 2020 at 15:12 UTC

Update: Issue resolved


We were able to use the syntax below. This is the only attribute we were able to use to send current date in our call.


${new java.text.SimpleDateFormat('yyyy-MM-dd').format(arsTasks.taskdate)}

This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.