Click HERE to see how Saviynt Intelligence is transforming the industry. |
04/12/2022 12:57 PM
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?
Solved! Go to Solution.
04/12/2022 02:01 PM
Hi Robert,
Below is working example for date variable in REST connector
startDate=${(new Date()).format('yyyy-MM-dd')}
04/12/2022 02:01 PM
Hi Robert,
You can also try the following.
${StatementDate = Calendar.instance; StatementDate.format('dd-MM-yyyy')}
04/12/2022 02:01 PM
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\",
04/12/2022 02:01 PM
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)}