Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to retrieve last 10 updated records in a table

subash bishra
Kilo Contributor

I want to get only 10 updated records from a table

1 ACCEPTED SOLUTION

Chandra Sekhar6
Tera Guru

Hi,

We can use setLimit() method

Example:

var gr = new Gliderecord('table_name');

gr.orderByDesc('sys_updated_on');

gr.setLimit(10);

gr.query();

View solution in original post

1 REPLY 1

Chandra Sekhar6
Tera Guru

Hi,

We can use setLimit() method

Example:

var gr = new Gliderecord('table_name');

gr.orderByDesc('sys_updated_on');

gr.setLimit(10);

gr.query();