I want to have a workflow where I need to do an HTTP action to an external server to fetch all new objects of the last week and then manage those. The external API allows me to pass a query attribute greater_than_date, where I can give a date. It should be the date of one week ago. So the workflow needs to get the current date and then subtract one week. Let’s check the documentation:
Subtract Time: Subtracts a selected amount of time from Variable A when Variable A is a date. Select a number in the Length field. This is the number of your selected units. In the Unit field, select from Seconds, Minutes, Hours, Days, Months, or Years. The transformed date cannot be before the current date.
As a consequence, I can’t generate this date using workflows. I get a specific error that dates can’t be in the past. I don’t understand why SailPoint has build this limitation in this basic functionality and I hope it will be added soon. The possible workarounds are to rely on an open API that allows us to perform date transformations that do support this, to create such an API ourselves, or to use a tool different than SailPoint that does support this, all of which are not ideal.
Also the documentation can be improved as it does not mention how we can get the current datetime in workflows, even when it is possible to fetch it.
That was my exact question as I read the documentation. I can see cases where an API would limit incoming parameters, but a “date/time library” should not impose such restrictions.
TBH I personally see this as a bug, even if it “works as documented”.
I asked the same question one month ago but didn’t get any feedback unfortunately.
Fully agree, this type of validation should not occur in this location indeed. I also consider it a bug, even though it was purposefully designed this way.
To get the date of yesterday very quickly for POC stuff without having to rely on performing HTTP requests, I did the following:
Take the current date
Use a substring to get the first four characters to obtain the current year.
Add 12 months to the current date
Subtract 1 day of the current date+1year (allowed since now it is in the future)
Use a substring to get the month and date of this (now+1year-1day)
Merge the two substrings.
This gives me the current year, together with the month and day that corresponds to next year’s yesterday.
This almost always results in the right date. It does fail if it is being calculated on the first of january (because in that case you need the previous year instead of the current year). It also fails on some leap day edge cases. For POC stuff we can live with this as it allowed me to continue on the important stuff. For production
this is of course terrible design on my end. All of this can be avoided if the limitation of creating dates in the passed is removed.
Hi Angelo! Thanks for your input on our Workflows documentation. I’ve created a Jira ticket (SAASDOCS-7350) to track the effort. We’ll update the comment thread when it has been addressed.
Thank you for your quick response, but can you please clarify what the ticket specifically is for as I’m afraid it misses the main point I’m trying to make.
My main feedback (mentioned in the title) was that the workflows does have good functionality to subtract date, because it breaks whenever the output date is earlier than the current date. The main feedback is not directed to the workflows documentation as the documentation very clearly mentions this functionality gap. The main feedback is that this behavior is undesired.
I additionally did add a small feedback point that the documentation does not mention how we can get the current datetime in workflows, even though this functionality exists.
Since you created a SAASDOCS ticket, is this ticket only related to the smaller feedback point I gave? If so, can you please create a jira ticket for the main feedback point as well? I would guess that this one would be a different one than a SAASDOCS ticket then.
Hey Angelo, thanks for the feedback! It looks like Rachel will take care of the docs side (nice!), and we’ll take care of the product side of your feedback like we always do
We have some notes internally on this, and we’ll bring it to the PMs
Thanks again for your feedback. The enhancement to allow transformed dates using the Subtract Time operator to be in the past has been released, and the documentation has been updated accordingly.