Select to view content in your preferred language

Arcade Task - Display ROW Acres in Popup Using ROW & Tax Parcel Layers

133
1
11-18-2024 09:11 AM
LeighOneill
New Contributor

Hello Community,

I am trying to build a popup expression (Arcade) calculating the acreage of one layer against another layer within the same AGOL web map. My goal is for it to be dynamic and something that prevents me having to recalculate every time the layer is updated. Can anyone point me to a similar solution or documentation that will help?

 

Thank you -

0 Kudos
1 Reply
LibbieWeimer
Emerging Contributor

Hi, can you please specify what you mean by "calculate the acreage of one layer against another layer"? 

If I'm assuming correctly that you need to do a mathematical calculation that uses the calculated acreage of a polygon as one input and a value from another layer as another input, then I'd advise that you look into the FeatureSetbyID documentation.

Then follow a workflow akin to this example: 

// call feature data and limit the fields to just the match field and the field you need for the calculation
var fs = FeatureSetByName(@map, "Layer", ['MatchField', 'FieldName'], false) 

//filter the featureset by match field using a sql query

var sql = "MatchField = '" + $feature.MatchField + "'"

var filtered_fs = Filter(fs, sql)

 

// get the data you need using the 'First' function since there should only be one row in your dataset

var FieldName = First(filtered_fs).FieldName

 

//do whatever calculation you need

return FieldName <whatever calculation you need>

 

0 Kudos