Amarjeet Pal
Kilo Sage
Options
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
12-29-2023
03:58 AM
I'm excited to share with you one of the most powerful features of flow and subflows. When working on long scripts, it can be overwhelming to write so many lines of code. That's why I've discovered a better solution - we can call a flow or subflow into any server-side or client-side script by using the 'create code snippet' option found on the right-hand side of the flow. This feature helps streamline your workflows, reduce manual errors, and improve overall efficiency in your organization.
Example of code :
(function() {
try {
var inputs = {};
inputs['catalog_item'] = ; // GlideRecord of table:
// Start Asynchronously: Uncomment to run in background. Code snippet will not have access to outputs.
// sn_fd.FlowAPI.getRunner().subflow('subflow_name').inBackground().withInputs(inputs).run();
// Execute Synchronously: Run in foreground. Code snippet has access to outputs.
var result = sn_fd.FlowAPI.getRunner().subflow('subflow_name').inForeground().withInputs(inputs).run();
var outputs = result.getOutputs();
// Current subflow has no outputs defined.
} catch (ex) {
var message = ex.getMessage();
gs.error(message);
}
})();
Thanks,
Amarjeet Pal
- 10,135 Views
4 Comments
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.