- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2017 10:43 AM
Does anyone know is it possible and if so than how to achieve that to get latest modified incident using REST API.
I'm able to get specific users incident (limited to 1 record), but I'd like to always get the latest modified one.
Any ideas appreciated.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2017 11:23 AM
Hi Pawel,
You can use an encoded query to control the order of records returned by the API. Try this:
https://yourinstance.service-now.com/api/now/table/incident?sysparm_limit=1&sysparm_query=ORDERBYDESCsys_updated_on
This will give you the last modified incident, but you can refine the query further by adding additional clauses to the query.
For more information, take a look at the sysparm_query documentation here: https://developer.servicenow.com/app.do#!/rest_api_doc?v=istanbul&id=r_TableAPI-GET

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2017 11:23 AM
Hi Pawel,
You can use an encoded query to control the order of records returned by the API. Try this:
https://yourinstance.service-now.com/api/now/table/incident?sysparm_limit=1&sysparm_query=ORDERBYDESCsys_updated_on
This will give you the last modified incident, but you can refine the query further by adding additional clauses to the query.
For more information, take a look at the sysparm_query documentation here: https://developer.servicenow.com/app.do#!/rest_api_doc?v=istanbul&id=r_TableAPI-GET