Run flow one time for all records
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2023 04:50 AM
I have the following flow. I want to trigger the first time for all records from the table. Appreciate how it can be done. I guess I have to do fake update on each record or not sure if a temporary trigger condition can be changed to execute for all of the records.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2023 05:02 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2023 05:08 AM - edited 12-01-2023 05:12 AM
Hi @Giri6
2 ways to do it.
- Copy the flow and lookup all current records first, do a for each loop in the flow.
- Copy the code snippet from flow designer, and use that in a fix script in a loop where you query all records.
Something like
var ci = new GlideRecord('cmdb_ci_computer');
ci.query();
while (ci.next()){
try {
var inputs = {};
inputs['current'] = ci; // GlideRecord of table:
inputs['changed_fields'] = []; // Array.Object
inputs['table_name'] = 'cmdb_ci_computer';
sn_fd.FlowAPI.getRunner().flow('<<FLOWNAME>>').inBackground().withInputs(inputs).run();
} catch (ex) {
var message = ex.getMessage();
gs.error(message);
}
}
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.