Select to view content in your preferred language

Arcade Intersect returns 2 values: Need help with formatting

647
2
Jump to solution
06-25-2023 07:00 PM
MPach
by
Frequent Contributor

I'm using a simple Arcade expression to return what I thought would be an single intersecting parcel polygon when a gravity main line feature was clicked on. In my short sightedness I hadn't realized it's possible for that gravity main line to exist across two parcels. 

This is what I thought it would always return:

MPach_0-1687744422758.png

It turns out though I can get something like this where both parcel numbers are returned and it looks messy:

MPach_1-1687744518674.png

Is there a way I can format my return statement to display multiple parcels separated by a comma?

Here's my code:

 

var parcel = FeatureSetByName($map, 'Parcel Boundary')

var parcelID = Intersects(parcel, $feature)

var parcel_details = ''

for(var row in parcelID) {
    parcel_details = parcel_details
    + row.PARCEL_ID 
}

return parcel_details

 

 

Tags (2)
0 Kudos
2 Solutions

Accepted Solutions
MPach
by
Frequent Contributor

Nevermind, figured out a solution after playing with it for a few minutes. 

var parcel = FeatureSetByName($map, 'Parcel Boundary')

var parcelID = Intersects(parcel, $feature)

var parcel_details = ''

for(var row in parcelID) {
    parcel_details = parcel_details
    + row.PARCEL_ID + " "
}

return parcel_details

Looks like I just needed to add a space after the Parcel_ID

View solution in original post

0 Kudos
MPach
by
Frequent Contributor

Definitely multiple answer here too. Stacking the labels with 

TextFormatting.NewLine

 in place of the space works nicely too. 

View solution in original post

0 Kudos
2 Replies
MPach
by
Frequent Contributor

Nevermind, figured out a solution after playing with it for a few minutes. 

var parcel = FeatureSetByName($map, 'Parcel Boundary')

var parcelID = Intersects(parcel, $feature)

var parcel_details = ''

for(var row in parcelID) {
    parcel_details = parcel_details
    + row.PARCEL_ID + " "
}

return parcel_details

Looks like I just needed to add a space after the Parcel_ID

0 Kudos
MPach
by
Frequent Contributor

Definitely multiple answer here too. Stacking the labels with 

TextFormatting.NewLine

 in place of the space works nicely too. 

0 Kudos