Here are my fields: [building_number], [street_name], [street_type], [street_direction], [city], [state]
I am trying to create an expression where, if the field [building_number] is empty, don't show any fields.
Else, return something like this:
Resident
[building_number] [street_name] [street_type] [street_direction]
[city], [state]
Solved! Go to Solution.
Hi Kelly Armstrong ,
Thanks for sharing the link, but it seems that the server is not responding. Also thanks for confirming that the field is indeed string. The problem with spaces is that they are difficult to detect visually. If there is a space we could use Trim function to strip them from the field before testing if it is empty. That would change the expression like this:
if (IsEmpty(Trim($feature["building_number"]))) {
return "";
} else {
return "Resident" + TextFormatting.NewLine +
Concatenate([$feature["building_number"], $feature["street_name"], $feature["street_type"], $feature["street_direction"]], ' ') +
TextFormatting.NewLine + $feature.city + ", " + $feature.state;
}
If indeed there is a string this could resolve the issue.
Hi OakdaleGIS ,
Can you confirm that you used the exact same expression that I posted? If I look carefully at the result below, it would mean that the expression is executed only partially, since there should be a blank line between "RESIDENT" and ", MN".
Thank you. It works great in a popup, but when using it with the "Public Notification" widget, I get this:
Hi OakdaleGIS ,
This is due to the fact that the newline is not supported yet. This will come in the near future.
Any update on this?