Flow Designer - How to find FLOWs based on the triggering table AND conditions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
I often need to analyse what triggers are configured and cannot find where to do this with FLOWs. For example, if I want to find all FLOWS are triggered by change_request.state I cannot see a way to do this. This is a backwards step for us that often are asked to decipher the novel, poor, and erroneous configuration on a platform. Now it seems we must manually look through hundreds of FLOWS to find the needle, instead of the simple search I run on Business Rules.
- I have found the table sys_hub_trigger_instance_v2 which has the trigger inputs that are encoded. It is not Base64 encoded, tried to decode it.
- I found the function in the Configuration Menu for a table that adds a column to a List Query javascript:sn_flow.AssociatedFlows.getFlows("change_request")
- There are some APIs available but the method sn_flow.AssociatedFlows.getFlowsWithTriggerDetails(tableName) just returns the FLOW, and thir tigger type and they do not seem to be accessible or documented
- There are other posts asking the same thing but none get to the detail of searching by the TABLE, Trigger, and the CONDITION.
var tableName = 'change_request';
var rawJson = sn_flow.AssociatedFlows.getFlowsWithTriggerDetails(tableName);
// Print the raw JSON string
gs.info('Raw JSON for table: ' + tableName);
gs.info(rawJson);
Business Rules
In Business Rules I can use the LIST and Filter by table, FilterConditions, or Condition, and you have your list. I do this regularly when I start diagnosing an issue or start on a new customer instance. https://[instance_name]].service-now.com/now/nav/ui/classic/params/target/sys_script_list.do%3Fsysparm_query%3DcollectionSTARTSWITHincident%255Efilter_conditionLIKEstate%26sysparm_first_row%3D1%26sysparm_view%3D
