The CreatorCon Call for Content is officially open! Get started here.

pass display value instead of sys_id in sysparm_query of REST API GET method

siddharthakadiy
Kilo Contributor

Hi all,

I am trying to retrieve incidents of a particular company from ServiceNow via REST API 'get' method. According to the wiki tutorial I have to pass the sys_id of company in sysparm_query parameter to filter out. But I want to pass the display value only; not the sys_id of it as i will not have the sys_id's of all companies in external clients/apps.

Please Help

Thanks

Sid

1 ACCEPTED SOLUTION

Brad Tilton
ServiceNow Employee
ServiceNow Employee

You should be able to dotwalk to the name field. This query should work to pull incidents where the company field on the incident is "Company Name".



sysparm_query=company.name=Company Name


View solution in original post

5 REPLIES 5

Brad Tilton
ServiceNow Employee
ServiceNow Employee

You should be able to dotwalk to the name field. This query should work to pull incidents where the company field on the incident is "Company Name".



sysparm_query=company.name=Company Name


All this time I was trying with quotes around the string. Now I removed the quotes and It worked.


Thanks a lot Brad


A really easy way to generate the query string with the right syntx is to use the filter to build the query in servicenow, then right click and copy the query.



Encoded Query Strings - ServiceNow Wiki


Hi Brad,



I am trying to filter the Application Records based on the Assignee name in my Rest Api call, Assignee field is a reference fields of Users table.



in that case how I will pass the assignee value for filtering the records in sysparm_query



Thanks and Regards,


Subrata