5

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?

0

4 Answers 4

8

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}
0

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)
1
  • I still dont think Newline is supported in the current Map Viewer. I don't think you can fix that with syntax
    – Rex
    Commented Jun 19, 2019 at 21:17
0

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

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.