Hi.
I've created a pythonscript contained in an ArcGIS Pro Toolbox (atbx), where I'd like to change a layer's symbology. I know it's possible to define a layer's symbology through the script parameters in the toolbox by setting the output layer as derived and also defining a lyrx file either as a property ofthe parameter or in the script it self. But in my case, the layer that I want to change symbology for is already added in the ArcGIS Pro project and is being used in a task. Therefore it's not possible for me to remove and add the layer as a derived parameter, since the task-resource for that layer will be broken.
I've tried using arcpy.ApplySymbologyFromLayer, but that doesn't work. There are no errors, but the layer symbology does not change. The lyrx-file works when importing symbology manually in Pro. What's the best practice here? Does anyone know what might be causing ApplySymbologyFromLayer to not have any effect?
One option is to define the new symbology based on the CIM-class, for example CIMUniqueValueRenderer. I've almost created the symbology this way, but I'm not able to set the defaultLabel. The symbology should show only to groups, <Null> and "All other Values". Has anyone got any experience with this?