Flow Designer: How to check if the Return Date is updated while Wait for 24 hours before Return Date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2023 07:04 AM
I am new to Flow Designer and I couldn't figure out how to add to check if the Return Date field has been updated by the user and it is today to bypass it while I have a Wait Condition to wait for 24 Hours before the Return Date to send a notification. Right now, it is able to wait for 24 hours before Return Date before proceeding to the next step. How can I add if the user updated Return Date by returning early by today to bypass the Wait condition to send a notification? Here is a screenshot example of my Flow,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2023 07:41 AM
Hi,
I believe you could use the "Wait for condition" action in this scenario.
Instead of using the "Wait for a duration of time" which is found under Flow logic, use "Wait for condition" which is found under Action > ServiceNow Core
With it you wait for a specific action to take place, for example a field is updated, and you can also enable a timeout, so it will not wait indefinitely.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2023 08:24 AM
Hi,
Thank you for the reply! What condition should I pick for Return Date is updated/changed because I do not see that in the option? I do see Enable timeout checkbox, but where can I set it up for 24 hours before the Return Date if the user didn't update anything on the Return Date?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2023 08:16 AM - edited ‎06-12-2023 08:18 AM
Hi @bbf35621 ,
Hope you are doing great.
to check if the Return Date field has been updated by the user and if it is today, in order to bypass the Wait Condition and send a notification, modify the flow:
- find out the point in flow where you want to check if it is updated and its today.
- Add a decision step and in decision step use below code to determine if the Return Date has been updated and is today
var returnDate = current.variables.return_date;
var currentDate = gs.nowDateTime(); /
// Check if Return Date has been updated and is today
if (returnDate != '' && returnDate.date() == currentDate.date()) {
// Return Date has been updated by the user and is today--> Bypass the Wait Condition and proceed to send the notification
gs.addInfoMessage('Return Date has been updated today. Skipping the Wait Condition.');
// Connect the decision step to the notification step in the Flow designer
}
else {
// Return Date has not been updated or it is not today, based on existing Wait Condition in your Flow
}
- Save the changes made to the Flow and test the updated behavior
Regards,
Riya Verma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2023 08:55 AM
Hi Riya,
Thank you for the help! What is the name of the decision step in flow designer? I only see a step called "Make a decision". I do not see any script box to fill out code and instead, it is required to create a Decision table. Do I need to create a decision table?