- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2025 02:34 PM - edited ‎01-21-2025 02:35 PM
I have a list collector on cmdb_group_contains_ci table. The display column defined for the table is 'group', so the list properly displays group names. However, I need to make this list a dependency of another selector that will select a group, and have the list display configuration items of the selected group instead. This is what I have in the list collector's Type Specification tab:
The dependency part works, however, the list still displays group name for each configuration item instead of the configuration item name. Both configuration_item and group are reference fields. What am I missing?
Pasting the actual Variable attributes string here for reference:
ref_auto_completer=AJAXTableCompleter,ref_ac_columns=configuration_item,ref_ac_columns_search=true,ref_ac_display_value=false,ref_qual_elements=select_ci_group
P.S. I understand I can change display value for the table to be configuration_item rather than group, but I don't want to break any existing functionality that relies on the existing definitions.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2025 12:30 AM - edited ‎01-29-2025 09:54 AM
Thank you, Ankur. I looked at some community examples and was under the wrong impression that it's possible to accomplish what I wanted by using Variable attributes and without changing the display value in the dictionary. Since this is not possible, I came up with a different solution, which I am explaining below in case someone else has a similar need.
1. In the list collector, instead of configuring List Table as cmdb_group_contains_ci, configure it as cmdb_ci (configuration item). In general, this approach should work for any reference field, by specifying the referenced table.
2. Create a server-side script include with a function to return the filter to be used to retrieve configuration items for the selected group. This involves two steps:
2a) Retrieve the selected group's CIs from the cmdb_group_contains_ci table:
2b) Use the selected CIs' sys_ids to return a query for cmdb_ci table: 'sys_idIN'+<list of IDs>:
return 'sys_idIN' + ci_array.join(',');
3. Invoke the above function in the list collector's Reference qualifier: javascript: (new GroupMembership).ciSelect()
4. Add your selection criteria to the Variable attributes field, e.g.: ref_qual_elements=select_ci_group
This solution is fully independent of how display attribute is set in the group membership table, and uses a script include to properly filter configuration items from cmdb_ci.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-21-2025 08:17 PM
after selecting the value it will always show the field value which is marked as Display=true on that table.
No other way to handle this
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2025 12:30 AM - edited ‎01-29-2025 09:54 AM
Thank you, Ankur. I looked at some community examples and was under the wrong impression that it's possible to accomplish what I wanted by using Variable attributes and without changing the display value in the dictionary. Since this is not possible, I came up with a different solution, which I am explaining below in case someone else has a similar need.
1. In the list collector, instead of configuring List Table as cmdb_group_contains_ci, configure it as cmdb_ci (configuration item). In general, this approach should work for any reference field, by specifying the referenced table.
2. Create a server-side script include with a function to return the filter to be used to retrieve configuration items for the selected group. This involves two steps:
2a) Retrieve the selected group's CIs from the cmdb_group_contains_ci table:
2b) Use the selected CIs' sys_ids to return a query for cmdb_ci table: 'sys_idIN'+<list of IDs>:
return 'sys_idIN' + ci_array.join(',');
3. Invoke the above function in the list collector's Reference qualifier: javascript: (new GroupMembership).ciSelect()
4. Add your selection criteria to the Variable attributes field, e.g.: ref_qual_elements=select_ci_group
This solution is fully independent of how display attribute is set in the group membership table, and uses a script include to properly filter configuration items from cmdb_ci.