I'm trying to use python to create a custom pop-up attribute expression in an ArcGIS Online Web Map, but I'm running into some issues.
Here is the python code I am running in an ArcGIS Pro Notebook:
import arcgis
gis = arcgis.gis.GIS("pro")
wm_item = gis.content.get("84a22dc69c57437d97292a12f05cf4d7")
wm_object = arcgis.mapping.WebMap(wm_item)
wm_object.layers[0].popupInfo.expressionInfos = [{
"name": "expr1",
"title": "test",
"expression": "'test'",
"returnType": "text"
}]
wm_object.update()
wm_object.layers[0].popupInfo.expressionInfos
The code appears to be working correctly, as I can see the expression I created when I open the web map's "configure pop-up" settings in a web browser:
However, when I click on a feature in the web map, the custom attribute I created is no where to be found:
Anyone know how to fix this?