Can I eliminate a field with a specific string using Arcade in my pop-up?

571
2
09-13-2021 11:34 AM
Labels (3)
ADHSGIS_Admin
New Contributor

We currently have a feature that we update monthly for the public as it pertains to certain facilities. In that feature class there is a field called "Fax Phone". In that field it contains both fax numbers and a string '( ) -' if a location does not contain an actual fax number (instead of it being empty it contains ' ( ) -').

My goal is to create an expression that states: If the fax phone field equals '( ) -' then show up blank. If it does not equal ' ( ) -' show the fax phone number.  

IIf($feature.FaxPhone == '( ) -', '', $feature.FaxPhone)  

This is my current expression but it does not seem to work properly because it still showcases the '( ) -' on my pop-up (image below). 

If anyone has some insight I will greatly appreciate it! 

ADHSGIS_Admin_0-1631557631413.png

 

Thank you, 

Josue 

 

 
0 Kudos
2 Replies
DavidPike
MVP Frequent Contributor

Code looks fine,  I might take a wild guess that you have a trailing space (which makes sense if there's some concatenation happening previously to generate that string), so maybe test for that.

'( ) - '

 

0 Kudos
JohannesLindner
MVP Frequent Contributor

Building on what David suggested:

 

IIf(Replace($feature.FaxPhone, ' ', '') == '()-', '', $feature.FaxPhone)  

 

Also, make sure you're actually showing the expression in the popup, not the field.


Have a great day!
Johannes
0 Kudos