I'm having a bit of a brain freeze on this problem. I want to use intersect to return a parcel that intersects with a point, and then I want to filter the featureset of parcels based on a owner address value found in my intersected parcel record. I'm having a hard time accessing the individual attributes of the intersected parcel however - I had thought something like $feature.attributename would work but this doesn't seem to work with featuresets. My workflow as i have been envisioning it is something like:
Objective here is to return the number (and list) of parcels which have the same owner address. Any thoughts?
Solved! Go to Solution.
Make sure you're getting features from the FeatureSet to get your attributes. Something like this:
var pFS = yourParcelFeatureSet;
var intersectedFS = Intersects(pFS, $feature);
var feat = First(intersectedFS); //assuming there is just one feature in the interection results
var owner = feat.OwnerAddress;
var filteredFS = Filter(pFS, 'OwnerAddress = @owner');
var output = [];
for (var f in filteredFS) {
Push(output, ` ${f.ParcelID}
`);
}
//this works for a Text element. Use <br> for an Arcade element
return `${Count(filteredFS)} parcels:
${Concatenate(output, '')}`
Make sure you're getting features from the FeatureSet to get your attributes. Something like this:
var pFS = yourParcelFeatureSet;
var intersectedFS = Intersects(pFS, $feature);
var feat = First(intersectedFS); //assuming there is just one feature in the interection results
var owner = feat.OwnerAddress;
var filteredFS = Filter(pFS, 'OwnerAddress = @owner');
var output = [];
for (var f in filteredFS) {
Push(output, ` ${f.ParcelID}
`);
}
//this works for a Text element. Use <br> for an Arcade element
return `${Count(filteredFS)} parcels:
${Concatenate(output, '')}`
That was my issue, I didn't realize i had to get that feature before accessing its attributes, very big help @KenBuja ! I have a few other things to sort out with this but so far this works well for my immediate need.