- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2023 06:51 PM
Hi Guys,
I am trying to call a subflow from a legacy workflow and I can't make it to work.
- I published the subflow and then copy code snippet
- In the workflow, I have a Run Script and pasted the code snippet
- I updated the input
- Run the workflow but the subflow is not triggered
Maybe I am missing something, could someone please help!Thank you!
(function() {try {
var inputs = {};
inputs['si'] = '4e6ae8ea1be9a91064adff39cc4bcb95'; // GlideRecord of table: sc_req_item//Start Asynchronously: Uncomment to run in background.Code snippet will not have access to outputs.
//sn_fd.FlowAPI.getRunner().subflow('global.oimnetworkgenericid').inBackground().withInputs(inputs).run();//Execute Synchronously: Run in foreground. Code snippet has access to outputs.
var result = sn_fd.FlowAPI.getRunner().subflow('global.oimnetworkgenericid').inForeground().withInputs(inputs).run();
var outputs = result.getOutputs();// Current subflow has no outputs defined.
} catch (ex) {
var message = ex.getMessage();
gs.error(message);
}})();
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-30-2024 11:00 AM
Hi Michael,
Sorry for the delay...
You need to do a GlideRecord query:
var reqID = current.sys_id; // get the sysID of the SI
var si= new GlideRecord('sc_req_item');
si.get(reqID ); // get the reference of the item request
inputs['si'] = si;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2024 12:39 PM
JLeong,
Did you ever figure out a solution? I'm having the same problem now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-30-2024 11:00 AM
Hi Michael,
Sorry for the delay...
You need to do a GlideRecord query:
var reqID = current.sys_id; // get the sysID of the SI
var si= new GlideRecord('sc_req_item');
si.get(reqID ); // get the reference of the item request
inputs['si'] = si;