- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2017 07:13 AM
I am having trouble with this query. I am trying to locate a record that was inserted within the last minute. Can someone help me build this query? I know I need to search for when it was updated on but I am having trouble figuring out the operator and value.
var gr = new GlideRecord('table');
gr.addQuery('sys_updated_on', ?, ?);
Should I be using either of the following:
minutesAgoStart() minutesAgoEnd()
any help would be appreciated.
Thank you.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2017 07:15 AM
Hi Ben,
You can use gs.minutesAgo(int) where int is the number of minutes ago you want to check.
GlideSystem Date and Time Functions - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2017 07:15 AM
Hi Ben,
You can use gs.minutesAgo(int) where int is the number of minutes ago you want to check.
GlideSystem Date and Time Functions - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2017 07:17 AM
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2017 08:33 AM
David,
Turns out I can't use this function with the scope I am working in. Do you have any other ideas?
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-06-2017 12:39 AM
Hi Ben,
Have look on developer.servicenow.com for the API methods available in scoped apps. The method on the link below might work for you but from a quick glance it looks like there are a few options that would fit your requirements.