Select to view content in your preferred language

getting attribute from featureset

230
2
Jump to solution
05-30-2024 08:49 AM
Labels (1)
clt_cabq
Occasional Contributor III

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:

  • make parcel feature set.
  • intersect parcels with $feature
  • obtain 'owner address' from intersected parcel feature set
  • filter original parcel feature set with the owner address.
  • display filtered records in popup, or at least a count.

Objective here is to return the number (and list) of parcels which have the same owner address. Any thoughts?

0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

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, '')}`

View solution in original post

2 Replies
KenBuja
MVP Esteemed Contributor

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, '')}`
clt_cabq
Occasional Contributor III

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.

0 Kudos