- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2021 02:43 AM
Hi Experts,
I have a use case, where I need to query ServiceNow incidents, which updated or created in the last 5 minutes. i.e- my query should get me only those records which either created or updated within 5 minutes, with the current time. I am using the ServiceNow API:- https://docs.servicenow.com/bundle/geneva-servicenow-platform/page/integrate/inbound_rest/reference/r_TableAPI-GET.html . here in the "sysparm_query" parameter, what query I should pass to get the records that were updated or created in the last 5 minutes.
sysparm_query = <how to form the query>
Any help will be much appreciated.
Thanks,
Amit Kumar
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2021 03:42 AM
Hey,
On the incident table build up a query like:
Right click the end of the query to copy query and you get:
sys_updated_onRELATIVEGT@minute@ago@5^ORsys_created_onRELATIVEGT@minute@ago@5
Pass this encoded query as your sysparm_query value.
Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2021 03:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2021 11:48 PM
Thanks Geoff, it working & i am getting the updated records.