How do I use the parenthesis in a url query?

Hang Lam
Kilo Contributor

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

2 REPLIES 2

Mike Patel
Tera Sage

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

Krzysztof6
Kilo Contributor

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?