I'm thinking of using https://www.esri.com/arcgis-blog/products/analytics/analytics/updating-your-hosted-feature-services-... to automate my feature services from one project, instead of a separate project for each service. mp = prj.listMaps()[0] is what tells it to use the first map in the project.
How does one find the Map # in a project with hundreds of maps? Say I want to publish the 30th map in the project.
Python is only outputting
prjPath = r"X:\GIS_Final\data\basedata\basemap\Maps\ArcGIS\ARCGIS_SERVER\GRSM_SPECIAL_USE_PERMITS\GRSM_SPECIAL_USE_PERMITS.aprx"
prj = arcpy.mp.ArcGISProject(prjPath)
mp = prj.listMaps()
mp
[<arcpy._mp.Map object at 0x000002560D31BDD8>]
mp = prj.listMaps
mp
<bound method ArcGISProject.listMaps of <arcpy._mp.ArcGISProject object at 0x00000256089FDFD0>>
Solved! Go to Solution.
Just add in the name of the map.
mp = prj.listMaps("MapName")[0]
I spoke too soon....
So here's what's going on. Despite the clear existence of the 3 maps...
Interesting that the print leaves out anything after "PERMITS". Perhaps a Map cannot be named so many characters long or something?
You might want to call technical support. I just tried this about 20 times using your naming and some others and I was able to replicate it the same problem. However it only happened a few of the times, which was strange. I did nothing different when those few failed. Maybe a bug. Sorry I don't have more for you.