Hide Field if Value=Null in Dashboard Details

474
5
09-29-2021 01:16 PM
Labels (1)
Aghyan
by
New Contributor II

I have used the below HTML code which basically gets the URL from the "Logo" field and displays the image next to the title in the Details widget.

<p><img src="{Logo}" style="float:right; height:12%; width:12%" /></p>

 

There are some Null values in the Logo field; that presents a small rectangle next to the title. How should I modify the code to hide Null values from the dashboard?

 

0 Kudos
5 Replies
jcarlson
MVP Notable Contributor

Here's the post you want: https://community.esri.com/t5/arcgis-online-documents/hide-field-in-pop-up-using-arcade/ta-p/1029496

Add the expression to a style parameter on the <p> element, and you should be all set.

- Josh Carlson
Kendall County GIS
0 Kudos
Aghyan
by
New Contributor II

I saw that post. It actually works in the AGOL pop-up. There is no Attribute Expression in the Dashboard Details widget. 

0 Kudos
jcarlson
MVP Notable Contributor

Oh, sorry. The Details widget just pulls the map's popup configuration. Or if the layer is being pulled directly into the dashboard not via a map, from the item's Visualization settings. Configuring the popup in the appropriate place will update the dashboard automatically.

- Josh Carlson
Kendall County GIS
0 Kudos
Aghyan
by
New Contributor II

This image (logo) needs to be displayed next to the title. They are not supposed to be displayed on the map pop-up.

The HTML code that I have used works perfectly but it only needs to be modified to hide the NULL values.

Aghyan_0-1632948030825.png

 

 

0 Kudos
jcarlson
MVP Notable Contributor

Oh, I see! The popup has its own "title", so I was confusing the two.

In this case, you can't use the layer directly. You'd have to use a data expression instead; are you familiar with those?

Or could you simply configure the popup to contain this instead, rather than doing it separately in the dashboard?

- Josh Carlson
Kendall County GIS
0 Kudos