Create HTML for popup with Arcade?

15956
21
09-29-2017 08:27 AM
RowenaTansley
New Contributor

Is it possible to create HTML for a popup with Arcade? Something along the lines of:

But that gives me this:

Any suggestions appreciated.

Thanks!

21 Replies
AlisonKelsey
Esri Contributor

Hi Rowena,

It is possible to configure pop-ups using a combination of HTML and arcade. You create your expressions in arcade, and then use the configure pop-up button to format the pop-up using HTML.  Once you've opened the configure pop-up dialog window (Figure 1), there is a toggle button that allows you to toggle between the standard interface and HTML (Figure 2).

Configure Pop ups.png

Figure 1: Shows the green configure button on the configure pop-up panel.  

Custom Attribute display.png

Figure 2: Shows the HTML interface and the toggle button (marked by red outline in this image).

I used a custom script to change the colour of font or background and called this script in the example above, using expression 1 in the example above.

DHighness
New Contributor III

I ended up doing as XanderBakker suggests but I don't actually see in his example. In the custom popup configuration I add the value in a DIV with a style "display" added. I used the Arcade expression to set the display style to either "block" or "none".

Expression "{expression/expr0}":

var ot = IIf($feature.FLDN>0,"block","none");
return ot;

HTML in Custom Attribute Display, HTML view:

<div style="display:{expression/expr0}">Attribute field value: <b>{FLDN}</b></div>

Now the line only displays in the popup if it has a greater than zero value.

0 Kudos