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

How to fetch Single Record by using Get Method through using TABLE API in REST API?

ram2497
Tera Contributor

How to fetch Single Record by using Get Method at TABLE API in REST API?

Please provide examples.

Thanks

 

8 REPLIES 8

Ankur Bawiskar
Tera Patron
Tera Patron

@ram2497 

Hope you are doing good.

If your query is resolved please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Ankur Bawiskar
Tera Patron
Tera Patron

@ram2497 

Hope you are doing good.

Let me know if I have answered your question.

If so, please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hitoshi Ozawa
Giga Sage
Giga Sage

If the question is about just receiving 1 record, Sudhanshu's reply of specifying parameter "sysparam_limit" to "1".
If the question is about getting a specific record, Muhammad's reply of specifying sys_id is correct.

The question also asked for an example and not just a syntax so below are example of these 2 cases. Substitute "<ServiceNow instance name>" with the instance name of ServiceNow being used.

Case 1: Example of getting the first record in Incident table.

https://<ServiceNow instance name>.service-now.com/api/now/table/incident?sysparm_limit=1

Case 2:Example of getting an Incident record with sys_id = '46e2fee9a9fe19810049b49dee0daf58'

https://<ServiceNow instance name>.service-now.com/api/now/table/incident?sysparm_query=46e2fee9a9fe19810049b49dee0daf58

Kenneth3
Tera Guru

Hi,


Anyone knows how to get the most recent record (so, not a random record) when you don't know the Sys ID?