- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago - last edited a month ago
Hi all,
I'm trying to conditionally filter a list view of the cmdb_ci_server table depending on how the user navigates to it.
Goal:
If the list is accessed directly via table navigation (e.g., cmdb_ci_server_list.do)
→ I want to apply a filter: manufacturer = VMware, Inc.
If the list is accessed via a reference field (e.g., u_server)
→ I want to show all records without any filter.
Question:
Is there any reliable way to distinguish whether a list view is opened from a reference field
or accessed directly via the table list view (e.g., cmdb_ci_server_list.do),
so I can conditionally apply the filter?
Alternatively, is there another recommended approach to apply different filters
based on how the list view was accessed?
Thanks in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
you can do this
If the list is accessed directly via table navigation (e.g., cmdb_ci_server_list.do)
→ I want to apply a filter: manufacturer = VMware, Inc.
-> use Query business rule on that table and check the URL contains table_list and is not called via reference qualifier, if yes then apply filter for manufacturer
If the list is accessed via a reference field (e.g., u_server)
→ I want to show all records without any filter. -> apply reference qualifier and show all
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
a month ago - last edited a month ago
@Rosfield, you can do this by editing the module for the respective class itself. (See snip below) Or modify the "All" servers module if you don't wish to load all servers without any filter.
Remember that if some one loads the table itself by typing "cmdb_ci_server.LIST" then system will load all the CIs from that Server class table. If you don't have any role condition in place then you can take following approach or else create different modules for different Server types.
For applying role based filter you can add roles as well.
Additionally if you wish to have more granular filtering condition with more advanced and complex conditions then do it from List Control. See snip below.
Hope this helps.
Let me know if it worked.
Regards,
Vikas K
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
Hello, thank you for your feedback.
My customer is concerned about users directly accessing tables via the .list view.
They prefer not to expose all CI information by default.
However, they do want all CIs to be visible when selecting a CI from Incident or Change forms.
I hope you understand that filtering access through modules alone is not sufficient in this case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
why not have different left nav modules for that and have fixed query applied to it using sysparm_fixed_query
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
a month ago
Hello, thank you for your feedback.
My customer is concerned about users directly accessing tables via the .list view.
They prefer not to expose all CI information by default.
However, they do want all CIs to be visible when selecting a CI from Incident or Change forms.
I hope you understand that filtering access through modules alone is not sufficient in this case.