Automatically additional filters applied in encodedquery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2025 10:45 PM
Hi Team,
I am observing some strange behavior in the ServiceNow code.
Script include code, calling from UI Action:
var name='abc';
var cc=new GlideRecord('core_company');
cc.addEncodedQuery('name='+name);
cc.query();
gs.info("CC query :"+cc.getEncodedQuery());
Result for ITIL User:
CC query: name=abc.
Result for Admin
CC query: name=abc^vendor_type=global^ORpublicly_traded=true.
Note:
From the background script additional filter is not applied.
Same additional filters applied, when I have tried the same code in a separate script include(only this function).
Can anyone please explain this, why these additional filters have been applied to the encodedquery?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2025 01:22 AM
I think this condition might have got added from a Query business rule. Can you check if there is any query business rule?
Palani