Select to view content in your preferred language

arcade: cancel new line in Null field

358
1
07-07-2022 12:18 AM
Labels (2)
gal_s_1993
New Contributor

hi,

I want in the popup tab that when I have a field that is NULL it will not open a new line.
I tried to add a feature like in the solutions offered to me and still does not work for me

I add this:

IIF (IsEmpty($feature.Location), "", "block");

 

and in the HTML this:

<table><tbody>  <tr style="display:{expression/expr0}">    <td style="width:125px; text-align:left; background-color:#ede8e8; padding:5px">Location</td>    <td style="width:225px; text-align:left; background-color:#ede8e8; padding:5px">{Location}</td>  </tr>  <tr style="display:{expression/expr1}">    <td style="width:125px; text-align:left; background-color:#ede8e8; padding:5px">Region</td>    <td style="width:225px; text-align:left; background-color:#ede8e8; padding:5px">{Region}</td>  </tr>  </tbody> </table>

 

And yet it does not cancel out the new line for me,
How can I undo the new line in an empty field?

thanks

Tags (2)
0 Kudos
1 Reply
jcarlson
MVP Esteemed Contributor

Try specifically setting the display value for null attributes to be none.

Iif(IsEmpty($feature.Location), 'none', 'block');

 Also, if you're using the new Map Viewer, there's an Arcade section that can be added to your popup that gives you a lot more control over the style and display of expression-based data.

- Josh Carlson
Kendall County GIS