Table API - Return all records that contain specific text

jfencil
Kilo Contributor

Hello All!

I appreciate any help I can get! I understand this may be a beginner question, but I need help!

I would like the Table API  to return all records that contain specific text.

For example, if a user enters Barkley for a location, I would like to return all locations that contain Barkley.

Here is the url that I am currently using, but when I try this, I do not get any data back:

"https://myinstancehere.service-now.com/api/now/table/cmn_location?sysparm_query=name%3DBarkley&sysparm_limit=10"

1 ACCEPTED SOLUTION

Not applicable

Try something like this:

 

https://myinstance.service-now.com/api/now/table/cmn_location?sysparm_query=nameLIKEBarkley&sysparm_limit=10

 

If you use the 'REST API Explorer',  you can copy the 'GET' under the 'Request' section. 

 

Tim

View solution in original post

10 REPLIES 10

jfencil
Kilo Contributor

So far I am not able to get any meanful data back by using nameLIKE but was successful using streetLIKE in my url. Maybe there is something else I am doing incorrectly? I removed the %3D.

 

I am getting:

{"result":[]}

 

LOCATION NAME: Does not return any data

"https://myinstancehere.service-now.com/api/now/table/cmn_location?sysparm_query=nameLIKEBarkley&sysparm_limit=10"

 

ADDRESS/STEET: Returns the correct location

"https://myinstancehere.service-now.com/api/now/table/cmn_location?sysparm_query=streetLIKE4747&sysparm_limit=10"

Are you trying using REST API Explorer? it is easier to debug from REST API Explorer

 

find_real_file.png

 

 


Please mark this response as correct or helpful if it assisted you with your question.

Mike Patel
Tera Sage

try 

"https://myinstancehere.service-now.com/api/now/table/cmn_location?sysparm_query=full_nameLIKEBarkley&sysparm_limit=10"

Thank you very much Mike Patel I really appreciate it! 

If this resolved your issue. Please mark answer correct so it doesn't appear on unsolved list.

Thanks