TransWikia.com

How to remove the thousands separator from multiple layers in ArcGIS Portal after publishing from ArcGIS Pro?

Geographic Information Systems Asked on October 5, 2021

I am publishing approximately 40 layers from ArcGIS Pro 2.5 to ArcGIS Portal. They all have the same data source. Each layer has a numeric ‘Year’ field. In Pro, the numeric field is formatted without the thousands separator. However, when I publish it to Portal, the thousands separator comma formatting appears and the year is "2,019" rather than "2019" in the pop-ups and data table. How do I prevent this from happening upon publishing? I don’t want to fix 40 layers. I need to refresh this data regularly.

I am also trying to avoid creating a new text year field and setting it to equal the numeric field because after that I will have to repeat the of hiding the old field and rearranging the order of the new fields step 40 times (once for each layer) before publishing it again to Portal.

2 Answers

The root cause of the problem (in my humble opinion) is that your data type shouldn't be a numeric field. A string field here would be more suitable, or - a formatted date field.

It sounds like you know this but I wouldn't go and create a new text field off the original numeric field. Change the data type of the numeric field. Whilst it will be more work to begin with, implementing customisations/code/work arounds in the downstream publication mechanisms is only going to cause on-going maintenance pain and is really just a cover up of the root cause of the problem.

A good approach might be to do both - Implement a temporary 'visual' fix in Portal as per other answers, such that end users get the aesthetic popup showing nicely formatted dates - whilst in the background, schedule the datatype change. Once implemented, rollback the visual datatype formatting.

Correct answer by nr_aus on October 5, 2021

Here is the manual way to fix this:

The formatting is governed by a setting in the webmap that uses these layers. Open your webmap with these layers in the Portal map viewer/editor. Click the ellipses (...) button to see more options. Choose the Configure Pop-up option. In the Configure pop-up dialog there is a link for Configure Attributes under the fields list. After opening this dialog you can see additional options for each field. If it is numeric there will be an option to uncheck 'Use 1000 Separator'. Turning this option off will show numbers the way you want in the map pop-up, attribute table and any widgets in use.

It may be possible to automate the workflow using the ArcGIS API for Python There is a popupInfo property for the layers.

Answered by Rich Wawrzonek on October 5, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP