Hello,
I am customizing the pop-up on my main layer (layer A) in a web map and want to include information from a separate layer (layer
. Both layers are point features. Layer A is tree points and Layer B is inspections on those trees, one inspection per tree. Not all trees have inspections. However, my expression is not returning the desired results.
Line 1 of my expression creates a unique id from two fields in layer A:
var treeuniqueid = Text($feature["Grant_ID"]+"_"+$feature["Tree_ID"])
Line 2 of my expression uses FeatureSetByName to access the attributes from layer B:
var inspection = FeatureSetByName($map,"UCF Tree Inspections - UCF Tree Inspections")
Line 3 adds in a filterStatement to match the records in layers A & B:
var filterStatement = "Tree_UniqueID = @treeuniqueid"
Lines 4&5 use Filter to only return the information for the selected tree point in the web map.
var inspected = Filter(inspection, filterStatement)
return inspected
In the expression window the results show that I am accessing layer B attributes:

but I get this in the pop-up itself:

Is using the created variable treeuniqueid to essentially 'join' the tables from the two layers an issue?
What else am I missing? Any and all help appreciated. Thank you, Francesca