Missing Tables when connecting to a map service using arcgis.gis

553
0
11-03-2020 09:08 AM
NathanKoski
New Contributor III

Hello,

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.

from arcgis.gis import GIS
from arcgis import features
from arcgis.features import FeatureLayer


gis = GIS('https://portalurl.com/portal','username','password')

#IncomingData
incoming_data_item = gis.content.get('Item ID')
incoming_data_tables = incoming_data_item.tables
print(incoming_data_tables)
incoming_data_layers = incoming_data_item.layers
print(incoming_data_layers)

#table layers

table_one = incoming_data_tables[0]

table_two = incoming_data_tables[1]

#query results
query_result_order = table_one.query(where=query)

query_result_customers = table_two.query(where=query)

This should return one Layer and two Tables, but it is only including the single layer, and the tables return empty.

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?

0 Kudos
0 Replies