Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

REST API filter using short description not working

ktmbdev
Giga Contributor

Hi,

I have tried the following approach to filter my API call using short description, but it was not working properly. its the same format on what i see when saving the query from the UI. Any ideas on how to make it work? Wanted to filter short descriptions that either contains the word password or access

 

incident?sysparm_limit=2^short_descriptionLIKEpassword^ORshort_descriptionLIKEaccess

 

 

1 ACCEPTED SOLUTION

Tony Chatfield1
Kilo Patron

Hi, REST Table API calls utilize the  'spam_query' parameter for filtering data and this field takes an encoded query,

Table API | ServiceNow Developers


Meaning your query would look like something like
Encoded query
short_descriptionLIKEpassword^ORshort_descriptionLIKEaccess

 

REST message
/api/now/table/incident?sysparm_query=short_descriptionLIKEpassword%5EORshort_descriptionLIKEaccess&sysparm_limit=10

View solution in original post

1 REPLY 1

Tony Chatfield1
Kilo Patron

Hi, REST Table API calls utilize the  'spam_query' parameter for filtering data and this field takes an encoded query,

Table API | ServiceNow Developers


Meaning your query would look like something like
Encoded query
short_descriptionLIKEpassword^ORshort_descriptionLIKEaccess

 

REST message
/api/now/table/incident?sysparm_query=short_descriptionLIKEpassword%5EORshort_descriptionLIKEaccess&sysparm_limit=10