Hi Esri Community,
I am seeking advice with an Arcade expression for pop up in Map Viewer. What I have are intersecting areas that follows an if/else statement shown as text. The code works displaying areas where the addresses that lay within the intersecting areas (planzone and rda) but anything outside does not display the return.
Is there a way without intersecting another boundary to display addresses that fall outside areas?
Thanks you in advance for any Arcade expression solutions.
Solved! Go to Solution.
**Edit: updated for a better response.
This is one way to do it
var planzone = First(...
var rda = First(...
var output = `ADDITIONAL DETAILS<br><br>
Zoning: ${iif(!IsEmpty(planzone), planzone.Zoning, 'No')}<br><br>
RDA Boundary: ${iif(!IsEmpty(rda), rda.ENTITY, 'No')}`
return {
type: 'text',
text: output
}
If you'd like a separate response if the feature falls outside both areas, you can use this instead
var planzone = First(...
var rda = First(...
var output;
if (IsEmpty(rda) && IsEmpty (planzone)) {
output = "Feature is outside the Zoning and RDA areas"
} else {
output = `ADDITIONAL DETAILS<br><br>`
output += `Zoning: ${iif(!IsEmpty(planzone), planzone.Zoning, 'No')}<br><br>`
output += `RDA Boundary: ${iif(!IsEmpty(rda), rda.ENTITY, 'No')}`
}
return {
type: 'text',
text: output
}
Note: pardon any typos. Using the Insert/edit code sample tool makes it easier to provide a good sample
**Edit: updated for a better response.
This is one way to do it
var planzone = First(...
var rda = First(...
var output = `ADDITIONAL DETAILS<br><br>
Zoning: ${iif(!IsEmpty(planzone), planzone.Zoning, 'No')}<br><br>
RDA Boundary: ${iif(!IsEmpty(rda), rda.ENTITY, 'No')}`
return {
type: 'text',
text: output
}
If you'd like a separate response if the feature falls outside both areas, you can use this instead
var planzone = First(...
var rda = First(...
var output;
if (IsEmpty(rda) && IsEmpty (planzone)) {
output = "Feature is outside the Zoning and RDA areas"
} else {
output = `ADDITIONAL DETAILS<br><br>`
output += `Zoning: ${iif(!IsEmpty(planzone), planzone.Zoning, 'No')}<br><br>`
output += `RDA Boundary: ${iif(!IsEmpty(rda), rda.ENTITY, 'No')}`
}
return {
type: 'text',
text: output
}
Note: pardon any typos. Using the Insert/edit code sample tool makes it easier to provide a good sample
It worked! You're an Arcade Wiz! Both expressions I found helpful in better understanding Arcade.