How do I use the parenthesis in a url query?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-30-2018 09:51 AM
Hi,
I'm trying to do url query using the sysparm_query parameter but I need to use the parentheses to group by selection criteria. For example in SQL I would write this:
select *
from Incident
where category = 'a'
and (subcategory = 'b' or subcategory = 'c')
How do I write the above query including the parentheses in a url query format using the sysparm_query parameter?
Thanks,
Hang

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-30-2018 01:01 PM
your query will be like category=A^subcategory=B^ORsubcategory=C url will be like
https://xxx.service-now.com/incident_list.do?sysparm_query=category%3DA%5Esubcategory%3DB%5EORsubcategory%3DC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2023 01:39 AM
Mike,
and can we use parentheses? I have a query where:
condition A or condition B or (condition C and condition D)
if I will not use parentheses I got wrong data.
I have checked it and parentheses not working, why is that? It might be problem with version or something else?