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?