from arcgis.gis import GIS
from arcgis.features import FeatureLayerCollection
import json
from arcgis.mapping import WebMap
gis = GIS("home")
I am trying to retrieve the forms on an existing webmap (that has layers with forms configured) using the following script:
wm_item = gis.content.get("itemid")
wm = WebMap(wm_item)
wm.forms
However, I get a long error message ending with:
ValueError: A layer url which can be used to generate a feature layer is required to use this module
Anyone else having this issue? This web map does containt layers and e.g. wm.layers does return the operational layers as an output. The script I run is pretty similar to the one given in de api documentation.
I figured out that it seems do have something to do with group layers. The function does not work properly when there are (nested) grouplayers configured in the webmap.
@PeterGoedbloed1 I got this error as well. I don't know how you figured that out, but you were totally right. I moved all the layers in the web map out of the group layer and it worked!! Thank you!!
I tried your suggestion but then I have the same error as before and a new one: ValueError: dictionary update sequence element #0 has length 1; 2 is required.
I've been troubleshooting this for a couple of days now, i'm really exhausted. 😞
If I create a new map, it works fine...