- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2025 06:19 AM
Hello Team,
How can I check if a Date/Time field is equal to the current date&time in Flow Designer?
I’m working with Workflow Studio (Flows) and need to compare a Date/Time field with the current date&time. I want to execute actions based on whether the field matches the current time.
How can I access this field correctly in a Flow Designer script, or is there a better way to implement this functionality?
Any help or examples would be greatly appreciated!
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2025 01:55 AM
so basically you want to wait till that date/time field value has reached?
If the date/time is reached then you want to proceed?
If yes then you can refer this link and enhance
Flow Designer : Making the flow wait until a specific date time based on a catalog variable
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2025 12:08 AM
Hi @BibekP ,
Solution 1: Use Relative Date Logic in Flow (if precision is not critical)
If you're okay with some flexibility (e.g., checking if it's "Today"), you can use:
- If current record.date_field on Today
- If current record.date_field before/after Now
Solution 2: Use a Script Step to Compare Time Within a Range
✅ Use this when you want to check if the field is within a few seconds/minutes of now.
(function execute(inputs, outputs) {
var fieldTime = new GlideDateTime(inputs.yourDateTimeField);
var now = new GlideDateTime();
var diffSeconds = Math.abs(now.getNumericValue() - fieldTime.getNumericValue()) / 1000;
// Allow a tolerance of 60 seconds
outputs.match = diffSeconds < 60;
})(inputs, outputs);
Input : yourDateTimeField: Date/Time from the current record
Output: match: Boolean (true/false)
If my response helped, please hit the 👍Thumb Icon and accept the solution so that it benefits future readers.
Regards,
Pratik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2025 01:04 AM
What are you exactly doing? Since date/time is stored in milli seconds, doing a comparison will almost always return false. You could do a check if it is before or after, or add 'wait' action/condition to your flow, but a solution would depend on you exact use case.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2025 01:55 AM
so basically you want to wait till that date/time field value has reached?
If the date/time is reached then you want to proceed?
If yes then you can refer this link and enhance
Flow Designer : Making the flow wait until a specific date time based on a catalog variable
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader