My goal is to create a pop-up expression using Arcade to show attribute values from a filtered related table two-relationships deep.
My data is related as follows;
Service Location (Point feature) --> Service Account (Table) --> Meters (Table)
I am able to create an pop-up expression for the Service Location that returns attributes from the related Service Account table, but I would like to go one level deeper and also return attributes from the related Meter table.
Currently my Arcade expression is;
var ServiceLocationGID = $feature.GlobalID
var ServiceAccounts = FeatureSetByName($map,"Service Account - Electric")
var filterstatement = 'ServiceLocationGID = @ServiceLocationGID'
var relatedData = Filter(ServiceAccounts, filterstatement)
var popupString = ''
for ( var f in relatedData){
popupString += "First Name: " + Text(Proper(f.firstname)) + TextFormatting.Newline
+ "Last Name: " + Proper(f.lastname) + TextFormatting.Newline
+ "Service Address 1: " + Proper(f.serviceaddr1) + TextFormatting.Newline
+ "Service Address 2: " + Proper(f.serviceaddr2) + TextFormatting.Newline
+ "Account Number: " + f.AccountNumber + TextFormatting.Newline + TextFormatting.Newline
}
return popupString
I am unsure on how to format the expression to then filter the meter table and return attribute values from the related record to include in my pop-up string.