I am trying to to filter a table in the new Map Viewer and show the filtered records in a popup. I have a fire incident map feature with associated units in the table.
This code only works if I put in the incident_number explicitly.
var incident = $feature.incident_number
incident = 23069675
var u = FeatureSetByName($map, "PFD CAD Calls - Units", ['incident_number', 'unit_id'])
var codeStatement = 'incident_number = @incident'; Console(incident)
var us = Filter(u, codeStatement)
Console(Count(us))
var popupString = 'Units:';
for(var x in us)
{
popupString += Text(x.unit_id)
}
return {
popupString
}