The CreatorCon Call for Content is officially open! Get started here.

Flow Designer - Issues Triggering Flow when a Data Time Field is TODAY

Damian Mudge
Tera Expert

QUESTION HAS BEEN RAISED IN THE CORRECT FORUM HERE:

 

https://www.servicenow.com/community/developer-forum/flow-designer-issues-triggering-flow-when-a-dat... 

 

I have created a new flow in 'Flow Designer' to automate a 'Chase Reminder' to the Customer when a new date and time field is the same as the System Date / Time.

 

The logic of the Workflow is as follows:

1. Triggers when a ticket is 'State' is "On hold" and the On hold reason is "Awaiting Integrated Customer".

2. Waits for until the date in the "On hold until" to be the same as TODAY

3. Waits 24hours

4. Looks up 'Trigger Record' and performs evaluation against defined conditions

5. Performs update actions defined in 'IF' or 'ELSE'. 

 

On every occasions the Workflow is reporting that the 'IF' criteria is not met ("evaluation is false") and bypasses the 'IF' action and completes to the 'ELSE' action. 

 

WORKFLOW EXECUTION:

DamianMudge_0-1724049992839.png

 

TRIGGER: The trigger logic is as follows and works as expected.

When the 'State' IS "On hold", AND 'On hold reason' IS "Awaiting integrated Customer" AND 'On hold until' IS 'true' OR CHANGES TO 'true' AND 'Date chase sent' IS 'null': 

DamianMudge_1-1724050408370.png

WAIT FOR CONDITION: The workflow then waits until the "On hold until" date is ON the System Date using a Flow variable and works as expected.

When "On hold until" ON 'Flowvariable = var gdt = new GlideDateTime(); return gdt.getValue();'

DamianMudge_2-1724050686253.png

 

WAIT SPECIFIC TIME: Wait 24 hours and works.

DamianMudge_3-1724051009398.png

 

LOOKUP Record and 'IF' / 'ELSE' :

The Trigger record is checked to see it still meets the criteria, then updates with either the 'IF' or 'ELSE' actions. This is where the evaluation against the 'IF' Conditions statement and where it reports that the 'Evaluation is False' bypasses the IF action and completes the 'ELSE' action and fails the evaluation check which is should be passing.

 

IF CONDITIONS:

IF the 'State' IS "On hold",

AND 'On hold reason' IS "Awaiting integrated Customer"

AND 'Chase count' IS "0"

AND 'On hold until populated flag' IS 'true'

AND 'On hold date' IS at or 'at or before' the 'System Date' [Scripted Flow variable: = var gdt = new GlideDateTime(); return gdt.getValue();]

DamianMudge_4-1724051115857.png

ELSE

Update Trigger Record 'Worknotes' AND revert 'State' to "In progress". and and works as expected.

 

'Conditions 1, 2, 3 & 4' are always met, so I believe the problem lays with Condition 5 and most likely flow variable, which is the same one that appears to work the initial 'WAIT FOR CONDITIONS

DamianMudge_5-1724052484417.png

There are no 'Transform functions' defined in 'Condition 5' and the flow variable is the same as used in the 'WAIT FOR CONDITION' and defined as: 

var gdt = new GlideDateTime();
return gdt.getValue();

 

Any help would be much appreciated.

 

 

1 ACCEPTED SOLUTION

Mark Manders
Mega Patron

Please close this question if you are posting the same again: https://www.servicenow.com/community/developer-forum/flow-designer-issues-triggering-flow-when-a-dat...


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

View solution in original post

4 REPLIES 4

Mark Manders
Mega Patron

Can't you let the field check to see if it's still the same as it was on the triggered record (create a flow variable, put the time stamp in there and evaluate if the timestamp is still the same as the variable? 

Because date/time is in ms, your flow runs the change of being ms's delayed, does a check and sees that it's already after that time and not 'at or before'.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

@Mark Manders The date and time put in manually the date and time field equates to a date and time stamp. The built-in delay when the "On hold until" date is TODAY wait for 24hrs, then perform the "Look up", surely should always be before the System Date, (unless the "On hold until" date has been changed since the workflow was initially triggered). 

What do your flow executions say about the fields and variables (their values)?


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Mark Manders
Mega Patron

Please close this question if you are posting the same again: https://www.servicenow.com/community/developer-forum/flow-designer-issues-triggering-flow-when-a-dat...


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark