Hi All,
For some reason my code which loop through my Unique Value Renderer group items started to fail and now it is not reading the field I give (Symbology) but the first field within the layer attribute table (similarly to when you set UniqueValueRenderer manually where the first field is the default one)
Is there anything wrong in the below, I have been investigating this for days ...
sym = layer.symbology
sym.updateRenderer("UniqueValueRenderer")
if sym.renderer.type == "UniqueValueRenderer":
sym.renderer.fields = ["Symbology"]
for grp in sym.renderer.groups:
for item in grp.items:
arcpy.AddMessage(item.label)
Thanks,
Ana