Not showing null in popups

734
6
11-03-2022 01:01 PM
MattBeyers
New Contributor II
0 Kudos
6 Replies
jcarlson
MVP Esteemed Contributor

I don't see anything wrong with the expression. Are you certain the fields are empty? That would be my first guess, that perhaps the field has strings which appear empty, but are a single whitespace character.

- Josh Carlson
Kendall County GIS
0 Kudos
MattBeyers
New Contributor II

This worked, thanks. (Where did those blank characters come from?!? 😉)

Not certain how to get it to not put a line break. Can that be done in HTML formatting, as some of the above links suggest? I switched to a NULL from "none", as below.

var np = $feature["New_Patien"]
return IIf(np==' ',NULL,'Phone for new patients: ' + np)

 

0 Kudos
SteveCole
Frequent Contributor

How about adding an additional condition and using the COUNT Arcade function to count the number of characters from the value returned? If the value is less than 2, treat it as a null condition.

0 Kudos
MattBeyers
New Contributor II

Hi, I will flag the first response as the solution. It solved the original issue. However, I am still seeing line breaks instead of null without a line break. Some of the links I referenced in the first post talk about taking care of line breaks in HTML. Does anyone have experience with that?

0 Kudos
jcarlson
MVP Esteemed Contributor

I'm assuming you're using the expression in a custom text element in your popup? And is this in the new map viewer, or the classic? The solutions vary depending on the context.

- Josh Carlson
Kendall County GIS
0 Kudos
MattBeyers
New Contributor II

Yes, a custom text element (attribute expression) and the new map viewer.

0 Kudos