When a feature layer in web map has a filter applied that results in 0 records, the behavior of the legend is to show only symbols of features that have records. However, when the same map is loaded into Experience Builder, the legend and layers widgets display all symbols for groups and categories styled in web map even if no records exist. This is unexpected behavior and tripped up my colleague and I.
This behavior can be resolved by removing those styles with 0 records from the feature layer in web map but I think that the default behavior of the legend in web map and legend/layers widget in Experience Builder should match. Can someone tell me if this is as designed or not?