Hello,
I'm trying to create an expression that will return the list of layers that are in a webmap.
So far I have this
from arcgis.gis import GIS
from arcgis.mapping import WebMap
gis = GIS("home")
wmItemId = "" #put the id of the webmap in here
wmItem = gis.content.get(wmItemId)
wm = WebMap(wmItem)for lyr in wm.layers:
print(lyr.title)
But get this error after running (when I have the webmap ID included)
Input In [1]
print(lyr.title)
^
SyntaxError: invalid non-printable character U+200D What could be causing this error? Also, is it possible to have the expression automatically generate a CSV file with the list instead of printing one? Any help is appreciated.
Thanks.