- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2019 09:36 PM
I'm attempting to run a simple comparison using the flow designer IF Flow Logic:
If [Date/Time 1] is after [Date/Time 2] then [do something].
However I receive an error on the flow with little to no detail on what the error is and the flow does not enter the if statement.
What would be the best way to debug the error? As the values appear to be correct. What would be causing this error?
Cheers,
- Mike
Solved! Go to Solution.
- Labels:
-
flow designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2019 08:41 PM
Update 1.1:
Confirmation received from HI/ServiceNow that this is a known bug with a fix in the 'Orlando' release.
In the interim a work-around such as the one in Update 1.0 can be used.
Or by changing the system wide date format to 'yyyy-mm-dd'.
Most Probable Cause: PRB1350626
Solution Proposed:
1. You are correct, this is a bug and has been fixed in the Orlando release as a part of PRB1350626.
2. Currently, it only works as expected when the date format in the system is set to yyyy-mm-dd
3. Anything other than this value will cause errors in a flow.
4. Hence, the workaround at this stage is setting the date format to yyyy-mm-dd.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2019 10:59 PM
Hi,
Go to system logs and you shall see the error in the log. Based on that you can debug.
Mark the comment as a correct answer and helpful if this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2019 02:14 PM
Thanks Asifnoor,
I was able to find the error in the system log as recommended and the error thrown suggests that I'm trying to compare two different data types, however as per above they are both Date/Time.
Flow Designer: Operation(User Action - Early Account Creation.If$1.evalConditions) failed with error: unable to evaluate condition for /if/_0_efb8957bdb2548501e36147a3a9619a1 = {0:D}>{1:D} is not a valid conditional expression: 07/06/2018 18:11:54was not a date in format (ParseCaseSensitive(false)(Value(Year,4,10,EXCEEDS_PAD)'-'Value(MonthOfYear,2)'-'Value(DayOfMonth,2))'T'(Value(HourOfDay,2)':'Value(MinuteOfHour,2)[':'Value(SecondOfMinute,2)[Fraction(NanoOfSecond,0,9,DecimalPoint)]]))[Offset(+HH:MM:ss,'Z')['['ParseCaseSensitive(true)ZoneRegionId()']']]: no thrown error
This is just using the OOB pill-drop, so I'm not sure where the clash is coming from?
Cheers,
- Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2019 02:14 PM
Thanks Asifnoor,
I was able to find the error in the system log as suggested.
Cheers,
- Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2019 07:00 PM
Update 1.0 (work-around):
I was able to get around this issue by putting the comparison directly into a custom 'action'.
The action returns a TRUE a FALSE if the specified date is 'before', 'equal to' or 'after' the current date.
//(-1) accStartDate is before currentDate
//(=0) accStartDate is equal currentDate
//(+1) accStartDate is after currentDate
var accStartDate = inputs.accStartDate
var currentDate = new GlideDate();
var compareDates = accStartDate.compareTo(currentDate)
if (compareDates <= 0){
outputs.result = true;
//gs.log('DEBUG (Date Comparison): ' + compareDates);
} else {
outputs.result = false;
//gs.log('DEBUG (Date Comparison): ' + compareDates);
}
I use the results of the custom action in another 'IF' Flow Logic to determine what the next steps should be.
Still awaiting ServiceNow HI team to investigate the apparent error/bug when doing a IF Date comparison.