
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2022 02:57 AM
Using Flow designer, I am wanting to add logic that waits for a date contained in a variable.
However, I want it to wait for a specific time on that date: 23:00:00
How would I achieve this? If I use wait for, it will wait for the set time after the flow was initiated on the date passed into the Flow.
Many thanks
Solved! Go to Solution.
- Labels:
-
Instance Configuration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2022 03:18 AM
Hi,
you need to use custom action and pass the date variable value
then in that return the date/time
see here
Flow Designer: reference the Current Date in an IF condition
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2022 03:18 AM
Hi,
you need to use custom action and pass the date variable value
then in that return the date/time
see here
Flow Designer: reference the Current Date in an IF condition
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2022 04:03 AM
Thanks
I have written the script:
(function execute(inputs, outputs) {
var gdt = inputs.endDate;
var atSix = gdt.toString().slice(0,10) + " 18:00:00";
var gdt = new GlideDateTime(atSix);
outputs.enddatetime = gdt;
})(inputs, outputs);
But this is returning the following in the output:
Would you be point out whats wrong with my script and why its returning 00:00:00?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2022 04:56 AM
Hi,
try this
(function execute(inputs, outputs) {
var date = inputs.endDate;
var gdt = new GlideDateTime(date + ' 23:00:00');
outputs.enddatetime = gdt;
})(inputs, outputs);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader