How to create a List Filter on a table

Kamva
Giga Guru

Hi Everyone,

I am trying to create a default filter for every users using our system, this table is not accessible by a module, you have to search it by table_name.LIST.

 

My attempt in achieving this business requirement by creating a Business Rule to run When is before with the below code, but it didn't work either.

(function executeRule(current, previous /*null when async*/) {
    current.addQuery('install_status', '1');
})(current, previous);

 

I have ran out of ideas now, can anyone please assist?

 

Regards,

Kamva

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@Kamva 

you should use before query business rule with proper query.

Form the query on table.list and then copy the query then use in business rule

current.addEncodedQuery('<YourQuery>');

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar Tried your suggestion, it doesn't work

@Kamva 

it should work fine.

did you use correct field name and choice value?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader