<?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 Missing Tables when connecting to a map service using arcgis.gis in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/missing-tables-when-connecting-to-a-map-service/m-p/292515#M22634</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to connect to a published map service using the python arcgis.gis api to get at some tables and layers that are attached to a map service on our portal.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;from arcgis.gis import GIS&lt;BR /&gt; from arcgis import features&lt;BR /&gt; from arcgis.features import FeatureLayer&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; gis = GIS('https://portalurl.com/portal','username','password')&lt;BR /&gt; &lt;BR /&gt; #IncomingData&lt;BR /&gt; incoming_data_item = gis.content.get('Item ID')&lt;BR /&gt; incoming_data_tables = incoming_data_item.tables&lt;BR /&gt; print(incoming_data_tables)&lt;BR /&gt; incoming_data_layers = incoming_data_item.layers&lt;BR /&gt; print(incoming_data_layers)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#table layers&lt;/P&gt;&lt;P&gt;table_one = incoming_data_tables[0]&lt;/P&gt;&lt;P&gt;table_two =&amp;nbsp;&lt;SPAN style="background-color: #f6f6f6;"&gt;incoming_data_tables[1]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#query results&lt;BR /&gt; query_result_order = table_one.query(where=query)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;query_result_customers&amp;nbsp;=&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;table_two&lt;/SPAN&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;.query(where=query)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This should return one Layer and two Tables, but it is only including the single layer, and the tables return empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code does work just fine when I am trying to reach a Feature Service, but this is a Map Service so I am curious if I should be doing something different. Can anyone weigh in?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Nov 2020 17:08:31 GMT</pubDate>
    <dc:creator>NathanKoski</dc:creator>
    <dc:date>2020-11-03T17:08:31Z</dc:date>
    <item>
      <title>Missing Tables when connecting to a map service using arcgis.gis</title>
      <link>https://community.esri.com/t5/python-questions/missing-tables-when-connecting-to-a-map-service/m-p/292515#M22634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to connect to a published map service using the python arcgis.gis api to get at some tables and layers that are attached to a map service on our portal.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;from arcgis.gis import GIS&lt;BR /&gt; from arcgis import features&lt;BR /&gt; from arcgis.features import FeatureLayer&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; gis = GIS('https://portalurl.com/portal','username','password')&lt;BR /&gt; &lt;BR /&gt; #IncomingData&lt;BR /&gt; incoming_data_item = gis.content.get('Item ID')&lt;BR /&gt; incoming_data_tables = incoming_data_item.tables&lt;BR /&gt; print(incoming_data_tables)&lt;BR /&gt; incoming_data_layers = incoming_data_item.layers&lt;BR /&gt; print(incoming_data_layers)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#table layers&lt;/P&gt;&lt;P&gt;table_one = incoming_data_tables[0]&lt;/P&gt;&lt;P&gt;table_two =&amp;nbsp;&lt;SPAN style="background-color: #f6f6f6;"&gt;incoming_data_tables[1]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#query results&lt;BR /&gt; query_result_order = table_one.query(where=query)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;query_result_customers&amp;nbsp;=&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;table_two&lt;/SPAN&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;.query(where=query)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This should return one Layer and two Tables, but it is only including the single layer, and the tables return empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code does work just fine when I am trying to reach a Feature Service, but this is a Map Service so I am curious if I should be doing something different. Can anyone weigh in?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Nov 2020 17:08:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/missing-tables-when-connecting-to-a-map-service/m-p/292515#M22634</guid>
      <dc:creator>NathanKoski</dc:creator>
      <dc:date>2020-11-03T17:08:31Z</dc:date>
    </item>
  </channel>
</rss>

