Hello,
I have point building data that contains multiple entries for the same facility (points on top of points in the same Feature Layer). The points are created each fiscal year.
I am trying to use Arcade to get the most current Fiscal Year data and populate any popup with the same facility ID.
Here is the code I have come up with:
//Access portal and Get Feature
var portal = Portal("https://*******************.maps.arcgis.com/")
var fac = FeatureSetByPortalItem (portal,"***************************", 0, ['*'],false)
//Filter features by 'FacilityID' when clicking on a feature
var this = $feature.FacilityID
var filterStatement = 'FacilityID =@this'
var allElement = Filter(fac, filterStatement)
//Select most current data
var popupString=''
if (allElement.FiscalYear =='2021-2022'){
popupString += allElement.TotalGHG
}
//format text
var popupStringB = Text (popupString, '###,###.0')
//populate popup
DefaultValue(popupStringB, 'no data')
Any suggestions would be appreciated.
Randy