Select to view content in your preferred language

Arcade & HTML: Hide <DIV> in popup if field value = xxxxx?

1072
1
Jump to solution
08-31-2023 01:52 PM
ArmstKP
Frequent Contributor

I am running into a brain blockage.  How would I not apply a div in my popup html if a field value = something?

Here is my div:

 

 

 

<div style="background-color:{expression/expr0};color:#FFFFFF;padding:7px;text-align:center;">
    <span style="font-size:medium;">{expression/expr1}</span>
</div>

 

 

 

0 Kudos
1 Solution

Accepted Solutions
JohannesLindner
MVP Frequent Contributor

Create another expression:

return IIF($feature.Field == xxxxx, 'none', 'block')

 

Use the output of that expression in the div's "display" style:

<div style="display:{expression/expr2};background-color:{expression/expr0};color:#FFFFFF;padding:7px;text-align:center;">
    <span style="font-size:medium;">{expression/expr1}</span>
</div>

 

For features with the specified value, this will hide (display:none) the div.


Have a great day!
Johannes

View solution in original post

1 Reply
JohannesLindner
MVP Frequent Contributor

Create another expression:

return IIF($feature.Field == xxxxx, 'none', 'block')

 

Use the output of that expression in the div's "display" style:

<div style="display:{expression/expr2};background-color:{expression/expr0};color:#FFFFFF;padding:7px;text-align:center;">
    <span style="font-size:medium;">{expression/expr1}</span>
</div>

 

For features with the specified value, this will hide (display:none) the div.


Have a great day!
Johannes