<?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: Access Non-Spatial Hosted Table with Python in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/access-non-spatial-hosted-table-with-python/m-p/1255539#M50173</link>
    <description>&lt;P&gt;Hi Josh, I have another question about accessing hosted tables. Each time I run the new line of code, a new sheet is added to my hosted table in the ArcGIS Online Map Viewer Classic. Is this supposed to happen and if so, is there any way to solve this?&lt;/P&gt;</description>
    <pubDate>Mon, 06 Feb 2023 22:52:16 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2023-02-06T22:52:16Z</dc:date>
    <item>
      <title>Access Non-Spatial Hosted Table with Python</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/access-non-spatial-hosted-table-with-python/m-p/1255026#M50132</link>
      <description>&lt;P&gt;Hi, I've been trying to access a non-spatial hosted table on ArcGIS Online with python and have been stuck here. I can search for the table and access its table id but I've been unable to access any of the table's data. I only want to access the table's data, not edit and re-upload the table.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;table = GIS.content.search('title: User List', 'Feature Layer')[0]
table_id = table.id
info = search_GIS.content.get(table_id) 
 &lt;/LI-CODE&gt;&lt;P&gt;Since I only need one column of the table, I first thought of extracting that column as a list and tried to query it but with the line below but I get the following Attribute Error:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;table_query = info.query(out_fields='UserName')&lt;/LI-CODE&gt;&lt;LI-CODE lang="c"&gt;AttributeError: 'Item' object has no attribute 'query'&lt;/LI-CODE&gt;&lt;P&gt;I've also tried converting the column to a spatial dataframe to work with using the line below but I get a KeyError: 'filter'.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;result = info.sdf&lt;/LI-CODE&gt;&lt;LI-CODE lang="c"&gt;AttributeError: 'Item' object has no attribute 'filter'&lt;/LI-CODE&gt;&lt;P&gt;Could someone point me in the right direction to access the hosted table with python? Also, is it possible to convert it to a pandas dataframe to easily work it?&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 20:39:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/access-non-spatial-hosted-table-with-python/m-p/1255026#M50132</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-02-03T20:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: Access Non-Spatial Hosted Table with Python</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/access-non-spatial-hosted-table-with-python/m-p/1255062#M50136</link>
      <description>&lt;P&gt;&lt;STRONG&gt;info&lt;/STRONG&gt; is an &lt;EM&gt;Item&lt;/EM&gt;, as the error message indicates. To access anything within the service, you need to use &lt;STRONG&gt;layers&lt;/STRONG&gt;, and, more specifically in your case, &lt;STRONG&gt;tables&lt;/STRONG&gt;. That will return a list of layers or tables, respectively, and you can access the one you need by index.&lt;/P&gt;&lt;P&gt;If it's a one-table service, try&lt;/P&gt;&lt;PRE&gt;info.tables[0].query(out_fields='UserName', as_df=True)&lt;/PRE&gt;&lt;P&gt;If you know the URL for the layer or table, you can also use the service URL to directly access it, rather than going through the Item.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 22:16:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/access-non-spatial-hosted-table-with-python/m-p/1255062#M50136</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2023-02-03T22:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: Access Non-Spatial Hosted Table with Python</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/access-non-spatial-hosted-table-with-python/m-p/1255538#M50172</link>
      <description>&lt;P&gt;Hi Josh that worked beautifully, thank you for the help!&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 22:46:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/access-non-spatial-hosted-table-with-python/m-p/1255538#M50172</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-02-06T22:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: Access Non-Spatial Hosted Table with Python</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/access-non-spatial-hosted-table-with-python/m-p/1255539#M50173</link>
      <description>&lt;P&gt;Hi Josh, I have another question about accessing hosted tables. Each time I run the new line of code, a new sheet is added to my hosted table in the ArcGIS Online Map Viewer Classic. Is this supposed to happen and if so, is there any way to solve this?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 22:52:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/access-non-spatial-hosted-table-with-python/m-p/1255539#M50173</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-02-06T22:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: Access Non-Spatial Hosted Table with Python</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/access-non-spatial-hosted-table-with-python/m-p/1255705#M50181</link>
      <description>&lt;P&gt;A new "sheet"? What does that look like? It does not sound like something that is supposed to be happening.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 14:28:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/access-non-spatial-hosted-table-with-python/m-p/1255705#M50181</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2023-02-07T14:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: Access Non-Spatial Hosted Table with Python</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/access-non-spatial-hosted-table-with-python/m-p/1568567#M62849</link>
      <description>&lt;P&gt;This worked for me also, thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2024 20:42:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/access-non-spatial-hosted-table-with-python/m-p/1568567#M62849</guid>
      <dc:creator>JDScharf</dc:creator>
      <dc:date>2024-12-13T20:42:16Z</dc:date>
    </item>
  </channel>
</rss>

