How to create a line break when concatenating text in ArcGIS online Arcade?

16259
19
12-19-2016 02:07 PM
MarcosMontelongo
New Contributor

When concatenating strings and attributes in ArcGIS online Arcade I would like to have the output in tow line.

In python it would be something like:

"Unit " + $feature.Unit + \n +$feature.Zone_

With the output looking like:

ResultValue
Result

Unit 2

Zone8400

TypeString
19 Replies
LesiMai3
Occasional Contributor

Hi Marcos,

I think it's called a text constant in Arcade. Maybe try this --

"Unit " + $feature.Unit + TextFormatting.NewLine + $feature.Zone_

Thank you,

Lesi

MegHoole1
New Contributor III

I tried using  + TextFormatting.NewLine + to build a stacked label in ArcGIS Online, but it still produced single line label

LesiMai3
Occasional Contributor

Hi Meg,

You're right. I should have tested it before posting. But the same expression is recognized by Pro 1.4 Alpha. So a workaround for now can be to author the label in Pro and then publish it. Maybe a support case can be filed to let esri know TextFormatting.NewLine is not working on ArcGIS Online?

 

Thanks,

Lesi

0 Kudos
JoshuaAndreas
New Contributor

Did that workaround work for you? For me, it still ignores TextFormatting.NewLine after publishing.

LesiMai3
Occasional Contributor

Unfortunately, no. The issue probably won't get resolved until the "bug" is logged...

PaulBarker
Esri Contributor

Just to clarify,  TextFormatting.NewLine is supported in Arcade from a language perspective. The problem you are seeing is related to the fact that currently ArcGIS Online does not support multi-line labels; that is independent of the labeling syntax.

LesiMai3
Occasional Contributor

Thanks for the clarification, Paul! Do we know when that capability will become available in ArcGIS Online/Portal?

PaulBarker
Esri Contributor

Unfortunately I don't have a timeline that I can share for multi-line labels. 

RyanNosek
Occasional Contributor II

I would also like to see this supported in ArcGIS Online.

Does anyone know if this has been logged as an enhancement or a bug so Esri can formally document it as something that needs addressed?