- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2022 11:14 PM
I have a true/false field A for the cmdb_ci table. When the field is true for the CI in cmdb_ci table and then I will raise an incident with the cmdb_ci , the particular choice A(I have also created a category choice as A same as field name) should be shown in the category of the Incident else it will not be shown.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2022 12:23 AM
Hi,
you should write onChange client script on cmdb_ci field on INC form
1) clear all the options from category
2) then based on true false value add the option you want
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading) {
return;
}
g_form.clearOptions('category');
var ref = g_form.getReference('cmdb_ci', callBackMethod);
}
function callBackMethod(ref){
if (ref.u_field.toString() == "true") {
g_form.addOption('category', 'choiceValue', 'choiceLabel');
}
}
regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2022 11:27 PM
Please give some screenshots and field names. Not it is a bit shot in the dark.
Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Martin Ivanov
ServiceNow MVP 2023, 2024
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2022 11:37 PM
table:
cmdb_ci_service_list- For ABC model cmdb_ci I have selected enable hypercare category as true
INC form:
Now when I raise a ne INC, when the application service ABC model is selected the hypercategory should be populated, else if the abc model has enable hyper care category setup as false the below choice will not populate in list:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2022 11:29 PM
Hi,
Configure the UI Policy for this as below.
UI Policy
Table - Incident
Condition - CI is not empty AND
CI.A is True (Value of that CI is true)
Advanced -> Script section (Run Script -true)
function onCondition() {
g_form.addOption('FIELD NAME','CHOICE VALUE', 'CHOICE LABLE')
}
Mark this as Helpful/Correct, if Applicable.
Regards,
Sourabh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-08-2022 11:49 PM
This is not working. It should be on based of CI .UI policy are onload