I'm all new to Python, and 'Im stuck with a problem:
Is it possible to use UpdateCursor on Feature Layers in AGOL?
I am trying something like this:
from arcgis.gis import GIS
gis = GIS("https://arcgis.com", "xxxxxx")
import arcpy
fs=gis.content.search(query="title:xxx, owner:xxxx", max_items=5000,)
kort = fs.layer[0]
fields = ["Fabrikat", "Entreprenør"]
with arcpy.da.UpdateCursor(kort, fields) as cursor:
for row in cursor:
if row[0] == "ABB":
row[1] = "3"
cursor.updateRow(row)
but its popping up with this error:
RuntimeError Traceback (most recent call last) in 2 lag = query_result1 3 fields = ["Fabrikat", "Entreprenør"] ----> 4 with arcpy.da.UpdateCursor(lag, fields) as cursor: 5 for row in cursor: 6 if row[0] == "ABB":
RuntimeError: 'in_table' is not a table or a featureclass
How can I make the cursor "eat" the layer?