AnsweredAssumed Answered

KeyError in Creating Web Map Inventory 

Question asked by ckandel_USGS on Jun 20, 2018
Latest reply on Sep 9, 2018 by bixb0012

 

I am trying to create a web map inventory and encountered a KeyError. 

 

gis = GIS("Portal url", "username", "password")
search_results = gis.content.search(query="tags:streamflow", item_type="Web Map")

l = []
for s in search_results:
   wmo = arcgis.mapping.WebMap(s)
   ops_layers = wmo['operationalLayers']
   basemap_layers = wmo['baseMap']['baseMapLayers']

KeyError: 'operationalLayers'

 

Any suggestions on how to handle KeyError? 

Outcomes