Select to view content in your preferred language

Arcade Expression for Pop-Up Intersect

301
2
Jump to solution
4 weeks ago
Labels (3)
GIS1CSGENGR
New Contributor

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. 


ESRI_Arcade_Question.png

 

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

**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

 

 

View solution in original post

2 Replies
KenBuja
MVP Esteemed Contributor

**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

 

 

GIS1CSGENGR
New Contributor

It worked! You're an Arcade Wiz! Both expressions I found helpful in better understanding Arcade. 

0 Kudos