- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
We have a UI Page which has a pop-up and if they click OK the processing script will run. In the processing script we call a sub-flow. Our issue is that the sub-flow updates a field, but the UI Page returns back to quickly to the form, so that the field being updated in the flow, does not reflect on the form, unless the user does a reload of the form.
So we want to delay the form from loading until the flow is completed. We have tried the setTimeout parameter but it does not seem to work. Any thoughts would be much appreciated.
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
did you try to call that subflow in synchronous manner?
share the complete script here.
you can use inForeground() method to make it run synchronous.
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
3 hours ago
did you try to call that subflow in synchronous manner?
share the complete script here.
you can use inForeground() method to make it run synchronous.
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
2 hours ago
Hi Ankur
Thanks so much for your response!
So here is my code in the processing script:
var processValue = process_bypass;
var urlOnStack = GlideSession.get().getStack().bottom();
if (processValue === "process") {
var inputs = {};
inputs.sir_sysid = sysparm_sys_id.toString(); // sys_id of SIR
sn_fd.FlowAPI.getRunner().subflow('bypass_workflow').inBackground().withInputs(inputs).run();
var message = '';
// ('Location Bypass Flow submitted');
message = gs.getMessage("Successful");
gs.addInfoMessage(message);
}
response.sendRedirect(urlOnStack);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Thanks so much, Ankur! It seemed to have worked!