Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2021 04:53 AM
Hi Ankur, the query I provided is the one I want but what would be the script? I'm not so familiar with the Flow API especially to use it on such a high amount of records.
I have this example for a single record from the Flow API documentation, but I would need to make it for the mentioned query.
(function() {
var now_GR = new GlideRecord('incident');
now_GR.addQuery('number', 'INC0000050');
now_GR.query();
now_GR.next();
try {
var inputs = {};
inputs['current'] = gr; // GlideRecord of table:
inputs['table_name'] = 'incident';
// Starts the flow asynchronously.
var contextId = sn_fd.FlowAPI.startFlow('global.myFlow', inputs);
} catch (ex) {
var message = ex.getMessage();
gs.error(message);
}
})();
// Call the cancel() method using the context Id returned from the startFlow() method
sn_fd.FlowAPI.cancel(contextId, 'Flow took too long to execute.');