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?
MUCHISIMAS GRACIAS A TI
Perfect! Thank you!
Having the same issue here. TextFormatting.NewLine works as it should in the preview, but once you accept the expression the text returns to a single line of text in the map.
The odd thing I have noticed is that even using Python's "" at the end of each line will give the correct preview but once you accept the expression the text returns to a single line in map.
Uhp, disregard, it did not work, sorry
Although the note remains the same about the API 3x, based on my preview from AGOL,
I think this is working now maybe...?
Expression:
$feature["RESP_DATE"] + TextFormatting.NewLine + $feature.CRRALL
Result:
2020-05-05T08:00:00-04:00
67.1
Hi David Forbuss, this works in ArcGIS API 4.x related products - Support Multi-Line Labels Using Arcade in AGOL
But, if you're still using ArcGIS API 3.x apps (e.g. Operations Dashboard) - this functionality wouldn't work - as you mentioned.
An interim solution would be to - pass a HTML tag for line breaks instead - <br />
For example:
{expression/expr0} + "<br />" + {expression/expr1}
This will cause any 4.x - apps and maps to look horrible, but will do the trick for 3.x related products.
Did this ever get resolved? Will it work in the expression builder now?
Update: I just tried this and unfortunately it doesn't work. Strangely, the TextFormatting.NewLine option is available under the "Constants" tab, but when you click the help button you get this message even though the test box is showing it as working:
Have we heard anything more if this has since become supported in AGOL?
Thanks Wendy!
Hi Natalie - it doesn't work in AGOL - it's a known issue at this point.
hope all is well!
wendy
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!
Hi MaryAnn,
You can use TextFormatting.NewLine
The text constants are found here: Types | ArcGIS for Developers
thanks
Wendy
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.