- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2018 06:57 PM
I'm testing a query of expected_start<=javascript:gs.hoursago(500) on the sysapproval_approver list. (500 is just a number of hours for test purposes only)
500 hours ago is like back in March. So why is it bringing back records with an expected start date of 4/3/2018?
4/3/2018 is not less than a date back in March (ie 3/1/2018) correct?
Lisa
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2018 07:25 PM
Because gs.hoursago(500) is invalid syntax.
Correct syntax (note the upper case A):
gs.hoursAgo(500)
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2018 07:25 PM
Because gs.hoursago(500) is invalid syntax.
Correct syntax (note the upper case A):
gs.hoursAgo(500)
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2018 04:29 PM
Yep it was as simple as syntax! I just tried it with gs.hoursAgo and it worked!!
Thanks!
Lisa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2018 08:30 PM
Hi Kemmy,
It is bringing correct records 🙂
It will bring all records, except the records from last 20 days.
The condition, itself states, it should bring all records where expected date(3rd April) is less than 20 days back(i.e. 500 hours).
Let me know in case of any issues. 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2018 12:01 AM
As it is syntax error:
try this,
javascript:gs.hoursAgo(24)