Need to fetch records from a table which were created in last 30 seconds.

oliver_pandey
Kilo Explorer

Hi Folks,

Urgent help required.

I need to built a query which will fetch the records from a table which were created in last 30 seconds. Currently I'm able to fetch the records of last 1 minute.

Here is the code :

var query = "sys_created_onONLast minute@javascript:gs.minutesAgoStart(1)@javascript:gs.minutesAgoEnd(1)";

var Event = new GlideRecord('sysevent');

Event.addQuery(query);

Event.query();

I tried using   "sys_created_onONLast minute@javascript:gs.minutesAgoStart(0.3)@javascript:gs.minutesAgoEnd(0.3)" for getting results of 30 secs but it did not work as expected.

Is there any SN function for seconds as we have for minutes.

Any suggestions would be appreciated.

Thanks

7 REPLIES 7

Oh, if I follow this logic, I think you'll have performance issues soon


Take care of not using this dashboard every 30 seconds



Instead I would more focus the monitoring on "error" with a notification or something.


Hi Karun,



I agree with David. This sounds like it could lead to performance issues. See: System Performance Best Practices - ServiceNow Wiki


hi @Chuck Tomasi can u provide new link the above link did not work