I am trying to find a way to make labels with line breaks in my web mapping. As of right now, everything I read on the GeoNet as well as GitHub says that the NewLine function is still not supported by ESRI and is not available in map view.
However, I keep coming across this ArcGIS for developers article about using the concatenate function with NewLine:
Is the script featured in the article above a way that I can create multi-line labels in AGOL? Does anyone have an update on this, or have you tried using Concatenate/NewLine without first defining a variable, etc.?
I'm coming across the same issues. I've read Arcade doesn't support newline in 3.x JSAPI and is supposed to be supported in 4.x JSAPI: https://community.esri.com/thread/187776-arcade-text-constant-for-textformattingnewline-is-adding-sp...
I've copied the Arcade syntax from the same page you're referring to in an attempt to create newline labels. In the Arcade window the script looks valid. But, it does not change the label in the web map??
The only way to get multiline labels through configuration in a web map in AGOL at this moment is configure the Arcade expression in the current web map and open the map in the beta map viewer in AGOL. This is build o the 4.X JS API and will show the labels on multiple lines.
However, the Map Viewer Beta, along with Experience Builder and 'newer apps' are written in 4.x and therefore honor new lines. The Map Viewer Beta does not have an option to configure labels - it is currently on the roadmap. In the meantime, you can configure labels with new lines in the standard Map Viewer. They will not display in the Map Viewer as it is written in 3.x. However they will be saved in the Web Map and when you view the Web Map through a 4.x app the labels will appear as you have configured.