<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: how to use setLimit I have total record as 30 and i want the records to be stored in batches in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/how-to-use-setlimit-i-have-total-record-as-30-and-i-want-the/m-p/2553477#M994467</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SantoshOraon_1-1683251987492.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/259179i0AEDF090643BCC73/image-size/medium?v=v2&amp;amp;px=400" alt="SantoshOraon_1-1683251987492.png" title="SantoshOraon_1-1683251987492.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;geting offset error?&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/28675"&gt;@Chaitanya Redd1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 05 May 2023 02:00:10 GMT</pubDate>
    <dc:creator>Santosh Oraon</dc:creator>
    <dc:date>2023-05-05T02:00:10Z</dc:date>
    <item>
      <title>how to use setLimit I have total record as 30 and i want the records to be stored in batches</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-use-setlimit-i-have-total-record-as-30-and-i-want-the/m-p/2553465#M994447</link>
      <description>&lt;P&gt;hello everyone ,I have requirement that..&lt;/P&gt;&lt;P&gt;how to use setLimit I have total record as 30 and i want the records to be stored in batches like if Batch =10 , then first 10 records are stored in my final array then , next 10 then, next 10 like that .&lt;/P&gt;&lt;P&gt;I am writing this script but only first 10 records are stored , i want in batches&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SantoshOraon_0-1683249304884.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/259176i637B869BEC6B9DA8/image-size/medium?v=v2&amp;amp;px=400" alt="SantoshOraon_0-1683249304884.png" title="SantoshOraon_0-1683249304884.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;thanks everyone&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2023 01:17:05 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-use-setlimit-i-have-total-record-as-30-and-i-want-the/m-p/2553465#M994447</guid>
      <dc:creator>Santosh Oraon</dc:creator>
      <dc:date>2023-05-05T01:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to use setLimit I have total record as 30 and i want the records to be stored in batches</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-use-setlimit-i-have-total-record-as-30-and-i-want-the/m-p/2553471#M994463</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;Try below code and let me know if you still find any error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var batch = 10;
var final_arr = [];
var gr = new GlideRecord('incident');
gr.addEncodedQuery();
gr.orderBy('sys_created_on'); // Replace sys_created_on with the field you want to sort by
var total_records = gr.getRowCount();
var batches = Math.ceil(total_records/batch);
for (var i = 0; i &amp;lt; batches; i++) {
  gr.setLimit(batch);
  gr.setOffset(i * batch);
  gr.query();
  while (gr.next()) {
    final_arr.push(gr.number.toString());
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2023 01:41:09 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-use-setlimit-i-have-total-record-as-30-and-i-want-the/m-p/2553471#M994463</guid>
      <dc:creator>Chaitanya Redd1</dc:creator>
      <dc:date>2023-05-05T01:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: how to use setLimit I have total record as 30 and i want the records to be stored in batches</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-use-setlimit-i-have-total-record-as-30-and-i-want-the/m-p/2553477#M994467</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SantoshOraon_1-1683251987492.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/259179i0AEDF090643BCC73/image-size/medium?v=v2&amp;amp;px=400" alt="SantoshOraon_1-1683251987492.png" title="SantoshOraon_1-1683251987492.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;geting offset error?&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/28675"&gt;@Chaitanya Redd1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2023 02:00:10 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-use-setlimit-i-have-total-record-as-30-and-i-want-the/m-p/2553477#M994467</guid>
      <dc:creator>Santosh Oraon</dc:creator>
      <dc:date>2023-05-05T02:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: how to use setLimit I have total record as 30 and i want the records to be stored in batches</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-use-setlimit-i-have-total-record-as-30-and-i-want-the/m-p/2553485#M994471</link>
      <description>&lt;P&gt;Can you share error?&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2023 02:23:14 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-use-setlimit-i-have-total-record-as-30-and-i-want-the/m-p/2553485#M994471</guid>
      <dc:creator>Chaitanya Redd1</dc:creator>
      <dc:date>2023-05-05T02:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: how to use setLimit I have total record as 30 and i want the records to be stored in batches</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-use-setlimit-i-have-total-record-as-30-and-i-want-the/m-p/2553488#M994473</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SantoshOraon_0-1683253599550.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/259181i28A99FF7B296F8F2/image-size/medium?v=v2&amp;amp;px=400" alt="SantoshOraon_0-1683253599550.png" title="SantoshOraon_0-1683253599550.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/28675"&gt;@Chaitanya Redd1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2023 02:26:51 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-use-setlimit-i-have-total-record-as-30-and-i-want-the/m-p/2553488#M994473</guid>
      <dc:creator>Santosh Oraon</dc:creator>
      <dc:date>2023-05-05T02:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to use setLimit I have total record as 30 and i want the records to be stored in batches</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-use-setlimit-i-have-total-record-as-30-and-i-want-the/m-p/2553489#M994474</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/28675"&gt;@Chaitanya Redd1&lt;/a&gt;&amp;nbsp; gr.setOffset() is not working&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2023 02:28:21 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-use-setlimit-i-have-total-record-as-30-and-i-want-the/m-p/2553489#M994474</guid>
      <dc:creator>Santosh Oraon</dc:creator>
      <dc:date>2023-05-05T02:28:21Z</dc:date>
    </item>
  </channel>
</rss>

