How to exclude CI in flow designer using system property

Arun61
Tera Contributor

i have created a system property with 20 cis sys ids how can i exclude these 20 cis in flow designer

How to call system property in flow designer

 
1 ACCEPTED SOLUTION

hi @Arun61 

 

Identify the CIs to Exclude: First, please ensure you have a clear list of the CIs you want to include. This list can be maintained in a few ways:
* Static List: Directly encode the list of CI sys_ids or names within the flow condition.
* Dynamic List: Store the list in a separate table or a field in an existing table where it can be updated without modifying the flow.
2. Modify the Flow: You need to edit the existing flow that changes the dropdown value when an SLA breach occurs.
* Access the Flow: Go to the Flow Designer in your ServiceNow instance.
* Edit the Flow: Open the flow that handles the dropdown change on SLA breach.
* Add a Decision Logic:

Every flow starts with a trigger, which defines when the flow should run. Set up your trigger based on the incident conditions, such as an SLA breach.

 

Add a Decision Step:

In the flow editor, click on Add Step.
Look for the Decision or If category (this might be named slightly differently depending on your version but generally falls under conditional logic).
Drag and drop the Decision step to your flow workspace where it needs to be applied.
Configure Decision Logic:

Click on the decision step to configure it.
You’ll need to define the conditions that determine the flow's path. For instance, you can set conditions based on the incident's CI, status, or other attributes.
Use conditions like is, is not, contains, etc., to set up your log


* Add a new condition before the action that sets the dropdown field to "inplan".
* This condition should check if the CI of the incident is not in the list of excluded CIs.


Use a Script if Necessary: If you need to perform a more complex lookup (e.g., checking a separate table), you may need to use a script step in the flow to perform this check

(function execute(inputs, outputs) {
  // List of CI sys_ids to exclude
  var excludedCIs = [
    'sys_id1',  // replace these sys_ids with the actual sys_ids of your CIs//
    'sys_id2',
    'sys_id3',
    'sys_id4',
    'sys_id5',
    'sys_id6',
    'sys_id7',
    'sys_id8',
    'sys_id9',
    'sys_id10',
    'sys_id11',
    'sys_id12',
    'sys_id13',
    'sys_id14',
    'sys_id15',
    'sys_id16',
    'sys_id17',
    'sys_id18',
    'sys_id19',
    'sys_id20'
  ];


  // Current CI from the incident record
  var currentCI = inputs.incident_ci;


  // Check if the current CI is in the excluded list
  if (excludedCIs.indexOf(currentCI) === -1) {
    // CI not in the excluded list
    outputs.change_dropdown = true;
  } else {
    // CI is in the excluded list
    outputs.change_dropdown = false;
  }
})(inputs, outputs);

 

A small request from my end, If you like this opinion and your problem is resolved after reviewing and applying it. Please kindly mark this your best answer‌(Accepted Solution)🌠‌ OR  mark it  Helpful ‌ if you think that you get some insight from this content relevant to your problem and help me to contribute more to this community

MackI | ServiceNow Developer | 2 *Mainline Certification | LinkedIn Top IT Operation Voice 2023 | Sydney,Australia

View solution in original post

7 REPLIES 7

Mark Manders
Mega Patron

What exactly are you doing? Do you have a script step in which you need to do something? Are you creating a record and don't want these CI's to be picked?  Please elaborate on what you are doing, because Flow Designer is a big thing and your question can relate to a lot of different parts.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

On incident table we have a dropdown field with dropdowns(new, inplan, rejected). when ever the incident sla breaches then we are setting dropdown as inplan. we are doing this via flow but now we have few CIs (20) if incident CI among those 20 then there is no change in dropdown. how can i exclude those 20 cis

MackI
Kilo Sage

HI @Arun61 

 

Your story is too short can you explain what you are trying to achieve? Can you elaborate in detail?

MackI | ServiceNow Developer | 2 *Mainline Certification | LinkedIn Top IT Operation Voice 2023 | Sydney,Australia

Arun61
Tera Contributor

Hi Mackl,

 

On incident table we have a dropdown field with dropdowns(new, inplan, rejected). when ever the incident sla breaches then we are setting dropdown as inplan. we are doing this via flow but now we have few CIs (20) if incident CI among those 20 then there is no change in dropdown. how can i exclude those 20 cis