<?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: Feature layer query returns wrong records in ArcGIS Notebooks Questions</title>
    <link>https://community.esri.com/t5/arcgis-notebooks-questions/feature-layer-query-returns-wrong-records/m-p/1119584#M449</link>
    <description>&lt;P&gt;thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;yea they are not available in the json so i guess its the server, i guess there is no way around it&lt;/P&gt;</description>
    <pubDate>Tue, 23 Nov 2021 16:50:43 GMT</pubDate>
    <dc:creator>StuartMoore</dc:creator>
    <dc:date>2021-11-23T16:50:43Z</dc:date>
    <item>
      <title>Feature layer query returns wrong records</title>
      <link>https://community.esri.com/t5/arcgis-notebooks-questions/feature-layer-query-returns-wrong-records/m-p/1119543#M446</link>
      <description>&lt;P&gt;so i want to query a feature layer thats accessed via AGOL but the actual features are served up from ArcGIS Server (i think its 10.3)&lt;/P&gt;&lt;P&gt;i have this in an ArcGIS Pro Notebook and it should be returning the second set of 100 records but instead its returning all 1800 records&lt;/P&gt;&lt;LI-CODE lang="python"&gt;UpdsFeat = FeatLyr.query(where = "DATEMODIFIED &amp;gt; (CURRENT_TIMESTAMP-45)",result_offset = 100, result_Record_Count = 100)&lt;/LI-CODE&gt;&lt;P&gt;is is because the feature service is coming from an old version of ArcGIS Server that doesn't support the result_record_count &amp;amp; Results_offset?&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Stu&lt;/P&gt;</description>
      <pubDate>Tue, 23 Nov 2021 14:57:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-notebooks-questions/feature-layer-query-returns-wrong-records/m-p/1119543#M446</guid>
      <dc:creator>StuartMoore</dc:creator>
      <dc:date>2021-11-23T14:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: Feature layer query returns wrong records</title>
      <link>https://community.esri.com/t5/arcgis-notebooks-questions/feature-layer-query-returns-wrong-records/m-p/1119579#M448</link>
      <description>&lt;P&gt;It's possible that the age of the server has something to do with it. Can you open the service JSON and see if those capabilities are there?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Nov 2021 16:35:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-notebooks-questions/feature-layer-query-returns-wrong-records/m-p/1119579#M448</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-11-23T16:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: Feature layer query returns wrong records</title>
      <link>https://community.esri.com/t5/arcgis-notebooks-questions/feature-layer-query-returns-wrong-records/m-p/1119584#M449</link>
      <description>&lt;P&gt;thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;yea they are not available in the json so i guess its the server, i guess there is no way around it&lt;/P&gt;</description>
      <pubDate>Tue, 23 Nov 2021 16:50:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-notebooks-questions/feature-layer-query-returns-wrong-records/m-p/1119584#M449</guid>
      <dc:creator>StuartMoore</dc:creator>
      <dc:date>2021-11-23T16:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: Feature layer query returns wrong records</title>
      <link>https://community.esri.com/t5/arcgis-notebooks-questions/feature-layer-query-returns-wrong-records/m-p/1119715#M450</link>
      <description>&lt;P&gt;In addition to those parameters, try setting the return_all_records parameter to False.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Nov 2021 22:31:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-notebooks-questions/feature-layer-query-returns-wrong-records/m-p/1119715#M450</guid>
      <dc:creator>MobiusSnake</dc:creator>
      <dc:date>2021-11-23T22:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: Feature layer query returns wrong records</title>
      <link>https://community.esri.com/t5/arcgis-notebooks-questions/feature-layer-query-returns-wrong-records/m-p/1119827#M451</link>
      <description>&lt;P&gt;thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/115587"&gt;@MobiusSnake&lt;/a&gt;&amp;nbsp;i tried that but it just came up with this error:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
In  [97]:
Line 2:     UpdsFeat = FeatLyr.query(where = "DATEMODIFIED &amp;gt; (CURRENT_TIMESTAMP-45)", return_all_records = False, result_offset = 100, result_Record_Count = 100)

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\features\layer.py, in query:
Line 1727:  return self._query(url, params, raw=as_raw)

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\features\layer.py, in _query:
Line 2998:  return self._query(url, params, raw=False, add_token=False)

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\features\layer.py, in _query:
Line 3034:  raise queryException

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\features\layer.py, in _query:
Line 2984:  path=url, postdata=params, add_token=kwargs.get("add_token", True)

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\_impl\_con\_connection.py, in post:
Line 1079:  force_bytes=kwargs.pop("force_bytes", False),

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\_impl\_con\_connection.py, in _handle_response:
Line 625:   self._handle_json_error(data["error"], errorcode)

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\_impl\_con\_connection.py, in _handle_json_error:
Line 648:   raise Exception(errormessage)

Exception: Unable to complete operation.
Unable to perform query operation.
(Error Code: 400)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 24 Nov 2021 09:04:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-notebooks-questions/feature-layer-query-returns-wrong-records/m-p/1119827#M451</guid>
      <dc:creator>StuartMoore</dc:creator>
      <dc:date>2021-11-24T09:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: Feature layer query returns wrong records</title>
      <link>https://community.esri.com/t5/arcgis-notebooks-questions/feature-layer-query-returns-wrong-records/m-p/1127079#M466</link>
      <description>&lt;P&gt;i couldn't get that to work so just used the objectIDs and did a filter to bring them back in small chunks of 1000, it then loads each chunk into a pandas dataframe&lt;/P&gt;&lt;LI-CODE lang="python"&gt;steps = 1000
z = 0
sOID = 1
MaxOID = 391283

while sOID &amp;lt; (MaxOID+steps):
    whereFil = "objectid &amp;gt;={0} and objectid &amp;lt; {1}".format(sOID,sOID+steps)
    Upd2k = xxdata.query(where = whereFil,out_fields = outFields)
    sOID +=steps
    if z == 0:
        resdf = pd.DataFrame(Upd2k.sdf)
        z +=1
    else:
        resdf = resdf.append(pd.DataFrame(Upd2k.sdf), ignore_index=True)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Dec 2021 08:31:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-notebooks-questions/feature-layer-query-returns-wrong-records/m-p/1127079#M466</guid>
      <dc:creator>StuartMoore</dc:creator>
      <dc:date>2021-12-17T08:31:43Z</dc:date>
    </item>
  </channel>
</rss>

