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 OakdaleGIS ,
This is due to the fact that the newline is not supported yet. This will come in the near future.
Hi OakdaleGIS ,
Could you try this?
if (IsEmpty($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;
}
Xander,
It works great. Only issue is after the concatenation, the elements have no spaces between them...
Thank you very much!!
Xander,
It does work. I was just seeing the concatenation in Arcade, when I actually utilized the expression, it worked with spaces.
Many many thanks!
Xander,
Actually, now that I have used/called the expression in the "Public Notification" widget, it does not function:
Hi OakdaleGIS ,
Could you look at the actual content of the building number field where you see this behavior? I am using the IsEmpty function and when the field is not actually empty it will not work. If the field is string, please check that there are no spaces in this field, since it will not be detected as empty.
I am not finding any spaces. How would you check? Also, this is a service from our ArcGIS Server, not a hosted feature service from AGOL.
Do you have access to the datasource of the AGS service to review the raw data in ArcMap/Pro to look for blanks?
Yes, the service is located here: Service
field: parcel_building_number ( type: esriFieldTypeString , alias: /\BLDG_NUM/\ , length: 10 )
I don't see any spaces...