I am creating a Floodplain information application for residents to review their pending floodplain change proposals. Ive created pop up showing the property information and intersecting floodplain information. I can get the first floodzone classification the parcel intersects, but I want to identify all the floodzone classifications the parcel intersects concatonated(ex: A, AE, VE, X ect...) Ive tried to use the below code but it doenst return any infoformation. I also dont want it to return redundant zones(ex: A, VE, A, X,X).
var FLDZN = Contains($feature,FeatureSetByName($map,"Flood Hazard Area"))
Solved! Go to Solution.
Your code works in testing (using an Arcade element) on my data. I've added the extra check so there aren't any duplicates
var FLDZN = Contains($feature,FeatureSetByName($map,"Buildings"))
var FLDZN_list = []
for (var f in FLDZN){
if (!Includes(FLDZN_list, f.Captureaction)) Push(FLDZN_list, f.Captureaction)
}
return {
type : 'text',
text : Concatenate(FLDZN_list, '<br/>')
}
I was using a field name in my data (Captureaction), but you must use your field name (OFFICIAL_N). Can you send it to me through Messages?
No 100% sure what messages are. I don’t get on these boards much.. Sorry. But happy to take direction. Feel free to message me or reply a quick how to message you. I changed the "Captureaction" to my attribute column, its called FLD_ZONE see code. The pop up looks like the picture below. and it didn’t actual create a list.. as the identified parcel show "XS" and it should be "XS, AE"1
var FLDZN = Contains($feature,FeatureSetByName($map,"Flood Hazard Area"))
var FLDZN_list = []
for (var f in FLDZN){
if (!Includes(FLDZN_list, f.FLD_ZONE)) Push(FLDZN_list, f.FLD_ZONE)
}
return {
type : 'text',
text : Concatenate(FLDZN_list, '<br/>')
}
Also my plan is to make a popup like below, not table pop up and actual dynamic one.. I’ve made them before with attribute expression then added then added the expression to a text popup.
The Contains function will return the list of features that are completely within the feature, which won't happen with most of the flood zones. Instead, you'll want to use the Intersects function.
var FLDZN = Intersects(FeatureSetByName($map, "Flood Hazard Area"), $feature);
var FLDZN_list = [];
for (var f in FLDZN) {
if (!Includes(FLDZN_list, f.FLD_ZONE)) Push(FLDZN_list, f.FLD_ZONE);
}
return {
type: "text",
text: Concatenate(FLDZN_list, "<br/>")
};
BTW, if you include code in your messages, you should use the "Insert/Edit code sample" button.
Glad to help. Don't forget to click the "Accept as Solution" button to the post(s) that answered your question.