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?
Ooops, sorry about it. My bad.
But, it would be great to get this working again
Gee
Of course, it depends on what you are labelling and not just wanting to use Arcade.
python is more mature if you are in a pinch... Arcade is still under development
Perfect! Thank you!
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:
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.
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
Uhp, disregard, it did not work, sorry
The odd thing I have noticed is that even using Python's "\r\n" 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.
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.