I'm using the new labeling functionality in ArcGIS Online. My question is how do I add a line break to the label if I want to use more than one field?
4 Answers
This is not possible in the current release of ArcGIS Online. You can add multiple fields to the label, but they will be drawn right to each other. You can of course add custom text by typing it into the text field, for instance.:
ID:{OBJECTID} // NAME:{NAME}
I know I'm about 4 years late to the party, but this is the best workaround. Use the Concatenate
to string features together and TextFormatting.Newline
to create a break function. Here is some example code:
Concatenate('Population: ',$feature.POPULATION,
TextFormatting.Newline, 'Demographic ', $feature.DEMOGRAPHIC)
-
I still dont think Newline is supported in the current Map Viewer. I don't think you can fix that with syntax– RexCommented Jun 19, 2019 at 21:17
You may check the below link as a reference. I didn't test the sample code yet, but i think it will help you as needed
https://developers.arcgis.com/javascript/3/jssamples/labels_arcade.html
It's the end of 2020 and there still isn't a way.
Here is an Esri tech support artice that gives a work around if you have values from multiple fields.
As a workaround, use two-layer labeling with top and bottom alignments for the desired feature layer in ArcGIS Online.
Note: These steps are only applicable to point feature layers and not polygon feature layers. For line feature layers, there are only three types of alignments.