How do I create multiline labels using Arcade functions?

20259
18
02-15-2017 06:10 AM
MaryAnnSteinmetz
Occasional Contributor

I'm trying to label polygons using two separate fields. I would like this to show on two separate lines. In desktop I use the vbnewline command. Is there an equivalent in Arcade?

18 Replies
WendyHarrison
Esri Contributor

Hi MaryAnn,

You can use TextFormatting.NewLine

The text constants are found here: Types | ArcGIS for Developers 

thanks

Wendy

NatalieMatthews
Deactivated User

Hey Wendy, TextFormatting.NewLine works for me in Pro, but not in AGOL. I've tried Chrome and Firefox. Do you know if this should work?

 "1" + TextFormatting.NewLine + "2"

Thanks!

WendyHarrison
Esri Contributor

Hi Natalie - it doesn't work in AGOL - it's a known issue at this point. 

hope all is well!

wendy

NatalieMatthews
Deactivated User

Thanks Wendy!

0 Kudos
AhnaMiller2
Frequent Contributor

Have we heard anything more if this has since become supported in AGOL?

by Anonymous User
Not applicable

Any news on this?

0 Kudos
DanPatterson_Retired
MVP Emeritus

from the help... so I guess not, unless the help is out of date

Constants | ArcGIS for Developers 

TextFormatting.NewLine

Inserts a new line, or line break, into the text. Multi-line labels are NOT supported in the ArcGIS API 3.x for JavaScript nor in the ArcGIS Online map viewer.

Example

Returns "T2N R1W"

"T" + $feature.TOWNSHIP + TextFormatting.NewLine + "R" + $feature.RANGE 
by Anonymous User
Not applicable

Unfortunately, this doesn't work.

DanPatterson_Retired
MVP Emeritus

That's what I said... it doesn't work.  read the help snippet I posted