Formatting Numeric or String Fields for address labels

2415
7
Jump to solution
03-03-2021 12:54 PM
MPach
by
Occasional Contributor II

First I'm going to start this for the ESRI people by stating that formatting is a basic everyday task that should be very simple.

I'm trying to display addresses as labels and the address comes in as 1,612 instead of 1612. I was looking for a way to calculate the field using a SQL statement and couldn't come up with anything. Then I tried to convert the numeric field to a string. Well, the default for strings when you bring them in from a numeric field is 1612.000. I tried to calculate and TRIM the trailing zeros and that didn't work. I'm out of ideas for labeling. If anyone can help I'd appreciate it. 

I did find this and haven't tried it yet, but I'd still like to know if there are slightly easier options. Formatting shouldn't be this difficult a thing. 

https://community.esri.com/t5/arcgis-online-ideas/attribute-table-float-field-formatting/idi-p/92628...

Thank you

0 Kudos
2 Solutions

Accepted Solutions
DanPatterson
MVP Esteemed Contributor

Are you saying you can't create the field as a text field to begin with?

@JoeBorgione any ideas?


... sort of retired...

View solution in original post

JoeBorgione
MVP Emeritus

ArcGIS Online is a horse of a completely different color.  It always helps to mention the platform you are using up front.

That said, in AGOL as I understand it, numeric formatting is controlled in the pop-up settings, and you can create an expression there that can be used for labelling purposes.  In the image below, I am labeling my address points with numeric ID.  That is an integer field. Note the commas: 

JoeBorgione_0-1614875382916.png

In the three-dot 'More Options' menu in the feature layer table of contents, I select configure Pop-Ups and choose Configure Attributes.  There I can turn off the commas in my numeric field: 

JoeBorgione_1-1614875667286.png

Uncheck and the labels look like this:

JoeBorgione_2-1614876073019.png

If that field were floating or double, there would have been an option for decimal places.

If you are going to concatenate fields for lables in AGOL can create a 'virtual' field using an Arcade Expression.  I can't take the time right now to go into that, but take a look here to start.

 

That should just about do it....

View solution in original post

7 Replies
DanPatterson
MVP Esteemed Contributor

Are you saying you can't create the field as a text field to begin with?

@JoeBorgione any ideas?


... sort of retired...
MPach
by
Occasional Contributor II

@DanPatterson  No, that worked, lol. I'm having a tough day. Regardless of that it still seems there should be some type of very simple formatting option for the tables in ArcGIS Online that allows you to change the formatting. I'd love to understand what the challenges are of having a feature like that if there are any. I used to work in the software industry, so I get it, there is a workaround for this, BUT this is an everyday thing. It seems a weird this wasn't something that was already addressed. 

0 Kudos
JoeBorgione
MVP Emeritus

I'm trying to display addresses as labels and the address comes in as 1,612 instead of 1612. I was looking for a way to calculate the field ...

Are you calculating the value of a field in your database that concatenates various field values, or are you trying to create a label on a map?  Are you using ArcMap or ArcGIS Pro?

If you're using ArcMap, we'll have to get someone else involved, because I don't use it anymore; ArcGIS Pro only, and I know just the guy;  @DavidPike are you seeing this?

Fill in the blanks for us here, and we'll try to get you going.

That should just about do it....
0 Kudos
MPach
by
Occasional Contributor II

@JoeBorgione I was making a map in ArcGIS Online. The data for the address field was a double, I know that doesn't make sense, but I didn't create the field. I think all our numeric fields are doubles though in order to try to keep consistency and so people don't have to think about it. Not my choice. Also, I tried a short int and long int field and the both show the same way in an ArcGIS online map as labels with a comma separator. 

What I had originally tried was manipulating the data field in ArcGIS Online. I converted the numeric field to a string field. That resulted in an address that was being displayed as 1,234 to being displayed as 1234.000, so that didn't work either. I tried to find a function to format the data, but there isn't one. That's really more what I was complaining about. It makes no sense to not have a way to format data for display purposes of labels for an Online map. It takes extra steps such as making a new field outside of the ArcGIS Online application such as in ArcMap or ArcPro and then adding that data back to ArcGIS Online in order to get it to display correctly. It's not a that many steps, but it's really completely unnecessary for something that is so simple. At the company that I used to work for if our software functioned that way every customer we had would have complained about it and they would have been correct to IMHO. The thing that really gets me is this appears to be a problem that has been an issue for at least 3 years and, to the best of my knowledge, has not been addressed in some way.   

0 Kudos
JoeBorgione
MVP Emeritus

ArcGIS Online is a horse of a completely different color.  It always helps to mention the platform you are using up front.

That said, in AGOL as I understand it, numeric formatting is controlled in the pop-up settings, and you can create an expression there that can be used for labelling purposes.  In the image below, I am labeling my address points with numeric ID.  That is an integer field. Note the commas: 

JoeBorgione_0-1614875382916.png

In the three-dot 'More Options' menu in the feature layer table of contents, I select configure Pop-Ups and choose Configure Attributes.  There I can turn off the commas in my numeric field: 

JoeBorgione_1-1614875667286.png

Uncheck and the labels look like this:

JoeBorgione_2-1614876073019.png

If that field were floating or double, there would have been an option for decimal places.

If you are going to concatenate fields for lables in AGOL can create a 'virtual' field using an Arcade Expression.  I can't take the time right now to go into that, but take a look here to start.

 

That should just about do it....
MPach
by
Occasional Contributor II

@JoeBorgione First off, thank you. 

While that works I can't say that it actually makes any logical sense. Instead of being able to go into the "Manage Labels" window and format the label that I want there I have to go into the "configure pop-up" window and change the formatting there for it to effect that labels 🤔. That really makes no logical sense for a workflow setup. What if I don't want a pop-up? Why would I look there? LOL. I'm glad it was simple solution and I thank you for your help, but whomever thought up that work flow wasn't thinking. Also, I ran into a refresh issue where I had to turn the label on and off before the stupid thing would update with my formatting change. It's my second day back in the office after working from home for a few months, so I'm attributing my lack of patience with having to get up earlier every morning. 😔

Again thank you for your help.  

0 Kudos
JoeBorgione
MVP Emeritus

I'm not a big AGOL user so I really can't comment on your concerns.  I'm sure it made sense to the team that designed and built it.  You have to remember that AGOL is an extremely lightweight application compared to the other ArcGIS power houses, so there are trade offs.  I did notice the refresh thing too; if you look at my screen captures they are two different sets of points....

That should just about do it....