Hi.
I'm trying to change the symbology of one of my layers in a python script. I've found the given layer
# Get layer "Vegteig" from active map
aprx = arcpy.mp.ArcGISProject("CURRENT")
m = aprx.activeMap
fl_vegteig = m.listLayers("Vegteiger")[0]
Then I'm trying to define a new UniqueValueRenderer for the layer:
symb = fl_vegteig.symbology
symb.updateRenderer("UniqueValueRenderer")
symb.renderer.fields = ['TILKNYTTET']
When I try to run this, I get this error:
The attribute 'fields' is not supported on this instance of UniqueValueRenderer
Does anyone know what might be wrong? I'm using almost the same code in another script (same toolbox), which works perfectly.