Select to view content in your preferred language

Custom Pop up on ArcGIS online

500
0
08-17-2020 09:33 AM
DinubaAGOLAdmin
Emerging Contributor

   I am creating an address generator so we can create labels for projects. I already have a couple set up. There was a question from one of the city workers if I could clean the labels up so they don't have an empty space.  I am using county data. There is a field {NAME2} which is a continuation of the first field. The problem I am having is that I wanted to use an "If else" statement so the system would print just {Name1} if {Name2} is Null or ' '. I know how to write the code in HTML, C++, Python, and Javascript. I really thought it would work in C++ because that is how I built all of my other custom pop ups. 

If I use C++, when I  use the > symbol the system turns it into  alt.  

It didn't recognize the Javacript and just made the pop up as is. 

I haven't tried python

My script starts like this: 

C++ 

   If ({NAME2} == null)

{cout << {NAME1} \n

cout << {ADDRESS1}\n

cout << {ADDRESS2};}

else {

cout << {NAME1} \n

cout << {NAME2} \n

cout << {ADDRESS1}\n

cout << {ADDRESS2};

}

Javacript

  If ({NAME2} == null)

{greeting = {NAME1} \n

greeting = {ADDRESS1}\n

greeting = {ADDRESS2};}

else {

greeting = {NAME1} \n

greeting = {NAME2} \n

greeting = {ADDRESS1}\n

greeting = {ADDRESS2};

}

0 Kudos
0 Replies