The CreatorCon Call for Content is officially open! Get started here.

Is is possible to apply filter with m2m table?

valter479
Tera Contributor

Is is possible to apply filter to a reference field that has a m2m table?

For example:

Locations (cmn_location) has m2m relationship with groups. When adding location to incident form, is possible to filter out only locations that have a specific group?

Thanks,

Valter

1 ACCEPTED SOLUTION

This is what the docs say

*****

Note: Related list queries must be enabled in System PropertiesList v3. Select the Allow related list query conditions to be added through the filter check box to enable it.

You can build a related list query for a list that uses List v2, however, the filter conditions cannot be modified until you removed the related list condition in the breadcrumb.

*****

So it can be used there is just no way to edit the query using the list until that part is removed.

Make sure you have the SNUtils installed in Chrome or Firefox.  Then go to Reporting and build the query you need using what ever filter.  Once done you can then just double click on some white space at the end of the filter breadcrumb and it will give you a popup that has the query you need to use.

 

View solution in original post

11 REPLIES 11

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

Yes, it should work.  Use the one shown below and the filter be be there automatically.

find_real_file.png

 

Read more about how relationships in SNOW work here: Relationships in ServiceNow Explained - Developer Community - Blog - ServiceNow Community

 

-Anurag

 

 

-Anurag

Can you provide an example, please?

I updated my previous answer, check that.

-Anurag

Hi Anurag,

I believe that's one to many. How about many to many? I can't find an example.

 

What would be the script to filter out the many to many groups?

 

find_real_file.png