sysparm_query and or

KristianF
Tera Contributor

 

I am trying to fetch data that was generated after 2 am and department in (X,Y,Z).

Only the 'updated_on' filter is applied. The department filters are disregarded.
I havent been able to find documentation on the correct syntax to use for this.
Any help would be much appreciated. 

 

https://instance.service-now.com/cmdb_ci_printer_list.do?CSV&sysparm_query=sys_updated_on>javascript%3Ags.dateGenerate('2025-07-22'%2C'02%3A00%3A00')^Department=X^ORDepartment=Y^ORDepartment=Z

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@KristianF 

try this

https://instance.service-now.com/cmdb_ci_printer_list.do?CSV&sysparm_query=sys_updated_on%3Ejavascript%3Ags.dateGenerate('2025-07-22','02:00:00')%5E(department%3DX%5EORdepartment%3DY%5EORdepartment%3DZ)

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

View solution in original post

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@KristianF 

try this

https://instance.service-now.com/cmdb_ci_printer_list.do?CSV&sysparm_query=sys_updated_on%3Ejavascript%3Ags.dateGenerate('2025-07-22','02:00:00')%5E(department%3DX%5EORdepartment%3DY%5EORdepartment%3DZ)

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

This is good. I wasnt aware I could use parenthesis to group the filters. I was using^NQ and repeating the sys_updated_on in each department query.