How to pass value for Duration type input type in subflow from script include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2022 06:50 AM
Hi,
we are calling a sub flow from script include like this.
Facing difficulty to pass the value for Duration Type input in flow designer
else {
var inputs = {};
inputs['record'] = grtechremainder;
inputs['reminder_duration_1'] = '0 hour(s) 10 minute(s) 0 second(s)'; // Duration
inputs['reminder_duration_2'] = 480000; // Duration
inputs['reminder_duration_3'] = 600000; // Duration
inputs['reminder_duration_4'] = 600000; // Duration
sn_fd.FlowAPI.getRunner().subflow('x_kpm13_enterprise.enterprise_standard_tech_status_reminder_notificatation').inBackground().withInputs(inputs).run();
}
And Flow is like this waiter should wait for 7 days. instead of adding 168 hrs in waiter condition we want to pass from script include. But i am not getting how to do that can you please help me on this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2022 07:36 AM
Hi,
try to set the milliseconds value and check
600000
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
‎01-18-2022 08:06 AM
Hi
Thanks for the input.
I have tried this but didnt work

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2023 02:14 AM
For future generations and future me: Use GlideDuration object. Example
var inputs = {
duration: new GlideDuration(60000) // you can use ms value
// or you can use duration string: new GlideDuration("00:01:00")
// see GlideDuration object documentation for more details
}
sn_fd.FlowAPI.startSubflow('global.<your_subflow_internal_name>', inputs);
There may be other ways to pass this value, but this one worked for me.