Hi all,
I've been using this incredibly helpful post (https://community.esri.com/t5/arcgis-online-blog/show-related-data-or-tables-in-pop-ups-with-arcade/bc-p/1560662#M1204) to get my pop-up to show data from a related feature layer.
My expression looks like this:
//Access 'Facilities' table as a featureset
var portal = Portal("https://www.arcgis.com")
var facilities = FeatureSetByPortalItem(portal, "1e189022e7064e0e9b1bdaadef6d3b78")
//Filter related features by Site ID
var varSite = $feature.siteid
var filterStatement = 'siteid = @varSite'
//related features as a variable
var relatedData = Filter(facilities, filterStatement)
//Sort related features
var relatedDataSorted = Orderby(relatedData,'facilitytype ASC')
var popupString = ''
var facilityCount = 0
for (var f in relatedDataSorted){
popupString += Text(f.facilitytype) + TextFormatting.NewLine
facilityCount=facilityCount+1
}
return popupString
This works great within the pop-up, but I'm now trying to extend it to the style of the layer, so that I can vary the size of the point depending on the 'Count' (i.e. number of related features).
At the moment the code doesn't work at all in the style expression builder - can anyone suggest where I'm going wrong?
Many thanks,
Helen