- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2024 02:30 AM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2024 02:45 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2024 02:45 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2024 06:15 AM
hi @Arun61
I hope you find some relevant guidelines in my last reply.
If my reply fixes your problem, I would like this opinion and your problem to be resolved after reviewing and applying it. Please kindly mark this your best answer(Accepted Solution) 🌠 if you think that you get some insight from this content relevant to your problem and help me to contribute more to this community
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2024 03:14 AM
@Arun61 : You can use look up record action on system properties table with your property name. Then you can access the value of the property and apply filter wherever its required. Thank You!