Hi,
We are connecting to SDE with ArcGIS Pro SDK to retrieve the polygon layer. We also have a symbology file for the same polygon layer.
So, when using the symbology layer to render the polygon feature layer, we're having trouble with settings some of its properties. In symbology layer we have a Boolean field "HasAlignmentSheet" which determines the color of polygon features(This field is not present within the polygon data layer).
Can anyone please provide the basic sample to use the symbology layer's renderer with the feature layer.
We have tried and currently we are getting the below output.

The code we have used to renderer this :-
//Connecting to geodatabase to get the polygon layer
Geodatabase geodatabase = new Geodatabase("Database Connection Properties")
featureClassAsTable = geodatabase.OpenDataset<Table>("Polygon Layer");
featureClassOpenedAsTable = featureClassAsTable as FeatureClass;
var layer = MapGlobal.Instance.map.Layers[1] as FeatureLayer;
List<FeatureLayer> featLayers = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().ToList();
FeatureLayer inputLayer = featLayers[1];
string symbologyLayer = @C:\ drive\A_SHEET_INDEX.lyr;
// using GP tool to add the symbology layer to the polygon layer
var parameters = Geoprocessing.MakeValueArray(inputLayer, symbologyLayer);
IGPResult pGPresult = await Geoprocessing.ExecuteToolAsync("management.ApplySymbologyFromLayer", parameters);
CIMUniqueValueRenderer UniqueValueRenderer = layer2.GetRenderer() as CIMUniqueValueRenderer;
// getting the two symbol from the symbology layer based on the field property "HasAlignmentSheet"
var hasNoAlignment = UniqueValueRenderer.Groups[0].Classes.Where(x => x.Label == "No Alignment Sheet").Select(y => y.Symbol).FirstOrDefault();
var hasAlignment = UniqueValueRenderer.Groups[0].Classes.Where(x => x.Label == "Has Alignment Sheet").Select(y => y.Symbol).FirstOrDefault();
// making changes in the renderer for the polygon layer
UniqueValueRenderer.DefaultSymbol = hasNoAlignment;
UniqueValueRenderer.UseDefaultSymbol = true;
//Setting the renderer for the polygon layer
layer2.SetRenderer(UniqueValueRenderer);
We are looking for the following output/ result

We want to remove the "all other values" from the symbology section as well as render the polygon features based on the Boolean field "HasAlignmentSheet" (we are fetching from the symbology layer)
Thanks