Select to view content in your preferred language

Remove/Hide Empty Line in Popup when Arcade Expression Returns Blank

95
3
Jump to solution
Thursday
Labels (1)
JoshBerna
Frequent Contributor

So, I'm sure many folks who've fiddle around with arcade expressions in webmaps have noticed that, when an arcade expression (added as a text element, not an arcade element) returns null in a popup, it still takes up a blank line as a sort of placeholder.

My question is if there's a way to hide this line. So, say my expression is this:

if($feature.status == "Demolished") {

     return "This Feature Has Been Demolished"

}

When $feature.status != demolished a line is still created in the place of where the text should be, resulting in an empty line in between popup elements, despite the lack of an else return statement such as "else return ""." 

I've seen similar posts about this in the community but haven't found a working answer. If anybody could tell me whether this is fixable or destined to be I would greatly appreciate it.

Thanks!

0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

It doesn't look like there's a way to do that within the text element. Is there way to replicate what you have in the text element in an Arcade element instead?

View solution in original post

0 Kudos
3 Replies
BrendanNewell
Esri Contributor

you could try the following at the end of a sentence in the popup rather than on a new line

if($feature.status == "PLN") {
     return (TextFormatting.NewLine + "This Feature Has Been Demolished")
}
else {
     return ""
}


Does this meet your needs?

 

🙂
0 Kudos
KenBuja
MVP Esteemed Contributor

It doesn't look like there's a way to do that within the text element. Is there way to replicate what you have in the text element in an Arcade element instead?

0 Kudos
JoshBerna
Frequent Contributor

Yes there is, whoops, I just had to return a dictionary in the element itself rather than a string. Still getting the hang of arcade. Thanks for the suggestion!

0 Kudos