Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Dynamic sys_id filter in Related List (Tags tab) – visibility in Conditions

pampapathi1
Tera Expert

Hi Team,

I’m working on a requirement where, in the Tags related list on a Configuration Item (CI), we need to show only the tags associated with the current CI record by default (i.e., filter dynamically using the current record’s sys_id).

Currently, I’m using a Relationship script like:

current.addQuery('configuration_item', parent.sys_id);

 

This works as expected, but the filter is not visible in the Related List “Conditions” UI, so users cannot see or modify it.

The requirement is to:

  • Apply a dynamic filter based on the current CI (sys_id)

Is there any supported way to achieve this?
Also, are there any scripts, UI actions, or best practices to make such dynamic filters visible or user-friendly in the related list?

Any suggestions would be really helpful.

Please find the screenshot of the related list conditions for reference

pampapathi1_0-1776860754648.png

 

Thank you

3 REPLIES 3

jcmings
ServiceNow Employee

To clarify - you aren't seeing the breadcrumbs/filter when looking at a related list, and you want something like the below screenshot:

jcmings_0-1776881445260.png

 

If that's the csae, you can Configure > List Control directly in the related list. You'll want to take a look at the Omit filters fields.

 

jcmings_1-1776881895123.png

 

jcmings_2-1776882041549.png

 

 

 

 

 


Thanks for the suggestion. In my case, I’m not trying to hide or control the visibility of filters in the related list.

My requirement is to apply a dynamic filter based on the current CI (sys_id), so that only tags related to the current record are shown by default.

I understand the List Control → Omit filters option controls visibility, but I’m specifically looking for a way to apply this dynamic condition in the Related List filter itself. So whenever I open a CI, the related list should automatically behave like this filter is applied for that specific CI.

Please let me know if there is any way to achieve dynamic filtering (based on current record) directly in the Conditions.

 

Thanks

jcmings
ServiceNow Employee

Hi @pampapathi1 - I understand now. I am surprised that your current relationship script is not working. I'd encourage you to check out some of the existing Relationships (System Definition > Relationships) records that you see to validate if yours is built the same way. Some of the questions that jump to mind for me are:

  • Are you sure you have set up the applies to/queries from tables correctly?
  • Is configuration_item is the actual name of the field you're working with?

If you'd like to share a screenshot of your Relationship record, I'd be happy to take a look. I'd start with the above first though.