<?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>topic Re: resultOffset parameter in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resultoffset-parameter/m-p/1058845#M73150</link>
    <description>&lt;P&gt;Thanks John ! Also it's quite confusing the parameters names are different from those in the REST API. I was indeed missing something !&lt;/P&gt;</description>
    <pubDate>Tue, 18 May 2021 08:27:59 GMT</pubDate>
    <dc:creator>ClémentLaskar</dc:creator>
    <dc:date>2021-05-18T08:27:59Z</dc:date>
    <item>
      <title>resultOffset parameter</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resultoffset-parameter/m-p/1058556#M73126</link>
      <description>&lt;P&gt;I must be missing something :&lt;/P&gt;&lt;P&gt;The REST API supports a resultOffset parameter to fetch records that are beyond &lt;SPAN class="usertext"&gt;maxRecordCount&lt;/SPAN&gt;. &lt;A href="https://developers.arcgis.com/rest/services-reference/enterprise/query-feature-service-layer-.htm" target="_blank"&gt;https://developers.arcgis.com/rest/services-reference/enterprise/query-feature-service-layer-.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;However, I cannot find this parameter in the 4.19 API &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-OffsetParameters.html&lt;/A&gt; nor in the 3.36 API &lt;A href="https://developers.arcgis.com/javascript/3/jsapi/query.html" target="_blank"&gt;https://developers.arcgis.com/javascript/3/jsapi/query.html&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;What is the way to get records with the 4.x version above maxRecordCount from my service ?&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;</description>
      <pubDate>Mon, 17 May 2021 15:14:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resultoffset-parameter/m-p/1058556#M73126</guid>
      <dc:creator>ClémentLaskar</dc:creator>
      <dc:date>2021-05-17T15:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: resultOffset parameter</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resultoffset-parameter/m-p/1058566#M73128</link>
      <description>&lt;P&gt;This is what I did with 10.5.1 services. There's probably a better way now but I haven't revisited it. The undefined &lt;FONT face="courier new,courier"&gt;queryObject&lt;/FONT&gt; variable is your original query object.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Set record limit to match the service being queried
const maxRecordCount = 1000;
// Ensure only one value for outFields (changed at 10.6.1)
// When returnCountOnly and returnDistinctValues are true,
// more than one field specified in outFields is not supported.
let queryForCount = queryObject.clone();
if (queryForCount.outFields &amp;amp;&amp;amp; queryForCount.outFields.length &amp;gt; 1) {
  queryForCount.outFields = [queryForCount.outFields[0]];
}
let queryTask = new QueryTask({url: "urlForMyLayer"});
queryTask.executeForCount(queryForCount)
.then(function(queryRecordCount) {
  if (queryRecordCount) {
    // Build array of page steps and use to query the service
    // as many times as necessary to retrieve all records.
    const pageCount = Math.ceil(queryRecordCount / maxRecordCount);
    let resultPages = [];
    for (let i = 0; i &amp;lt; pageCount; i++) {
      resultPages.push(i * maxRecordCount);
    }
    return Promise.all(resultPages.map(function(resultPageStart) {
      queryObject.start = resultPageStart;
      queryObject.num = maxRecordCount;
      return queryTask.execute(queryObject);
    }));
  } else {
    // No records to query; send back an Array with one empty FeatureSet
    // to mimic the return from Promise.all()
    console.log('No records to query');
    return Promise.resolve([new FeatureSet()]);
  }
})
.then(function(featureSets) {
  // Combine all features into the first FeatureSet for return.
  let returnFeatureSet = featureSets.pop();
  featureSets.forEach(function(featureSet) {
    Array.prototype.push.apply(returnFeatureSet.features, featureSet.features);
  });
  resolve(returnFeatureSet);
})
.catch(function(err) {
  reject(err);
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 May 2021 15:37:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resultoffset-parameter/m-p/1058566#M73128</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-05-17T15:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: resultOffset parameter</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resultoffset-parameter/m-p/1058572#M73129</link>
      <description>&lt;P&gt;Since you'll be using&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#properties-summary" target="_self"&gt;Query&lt;/A&gt;&amp;nbsp;to retrieve the features, check out the properties available in this class; and related to your question the 'start' parameter:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-support-Query.html#start" target="_self"&gt;Query.start&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 May 2021 15:40:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resultoffset-parameter/m-p/1058572#M73129</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2021-05-17T15:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: resultOffset parameter</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resultoffset-parameter/m-p/1058845#M73150</link>
      <description>&lt;P&gt;Thanks John ! Also it's quite confusing the parameters names are different from those in the REST API. I was indeed missing something !&lt;/P&gt;</description>
      <pubDate>Tue, 18 May 2021 08:27:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resultoffset-parameter/m-p/1058845#M73150</guid>
      <dc:creator>ClémentLaskar</dc:creator>
      <dc:date>2021-05-18T08:27:59Z</dc:date>
    </item>
  </channel>
</rss>

