- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2022 06:15 PM
Hi -
I am trying to restrict records based on model category and location. Here is the encoded query that works in filter query but when I try to apply this in Business Rule before query it doesn't work. It returns all records. This has to do something with using 'NQ' and it seems like it provides inconsistent returns. I tried changing it to "OR" but that doesn't work either. Please help.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2022 08:16 PM
You may want to get the current query and then add the new conditions to it.
var enc = current.getEncodedQuery();
While adding, please ensure that the conditions are applied appropriately as otherwise it will end up returning all rows.
Thanks,
Arav

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2022 10:25 PM
If you could post the script, I can try to modify it
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2022 07:15 PM
Hi,
This could be due to a known platform behavior (not issue). Please see the article below for more details.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0564887
Thanks,
Arav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2022 07:32 PM
Thanks! any suggestion or workaround for this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2022 08:16 PM
You may want to get the current query and then add the new conditions to it.
var enc = current.getEncodedQuery();
While adding, please ensure that the conditions are applied appropriately as otherwise it will end up returning all rows.
Thanks,
Arav

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2022 06:43 PM
@Community Alums checking back to see if you were able to apply the suggestion provided