In ArcGIS Desktop, we had arcpy.mapping.Layer.addAllValues(). I used this for a straightforward workflow to dynamically symbolize a unique values layer and show it in the legend. I only want to show certain values in the legend (those within a certain distance from the feature). The layer has hundreds of unique values. Symbolization color is not incredibly important and was manageable via a custom color ramp.
Workflow:
Result: Layer and legend would have a symbol class for only those features that meet the definition query.
This was a quick and easy way to get this done. In ArcGIS Pro and arcpy.mp, there does not seem to be an equivalent to arcpy.mapping.Layer.addAllValues() and it looks like cracking into the CIM is going to be necessary and my code is about to get a lot more complicated. Am I missing something?
I believe you can just set the layer symbology to UniqueValueRenderer
https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/uniquevaluerenderer-class.htm