How To: Retain reordered attribute fields when publishing a feature class from ArcGIS Pro to ArcGIS Online
In ArcGIS Pro, after reordering the fields of a feature class within an attribute table and publishing the feature class to ArcGIS Online, the order of the fields is not retained when viewed in ArcGIS Online.
In some instances, it is necessary to retain the reordered fields when opened in ArcGIS Online before continuing to work in the online environment. To do this, attribute field mapping must be used to control how the attribute fields from an input dataset are processed and written to an output dataset, before publishing the output dataset to ArcGIS Online. Refer to the following document for more information on the attribute field mapping: Attribute field mapping.
The Feature Class to Feature Class tool has a Field Map parameter that provides the ability to reorder the fields of an input feature class and output a new feature class with the reordered field. These instructions describe how to use this tool to retain reordered fields when publishing a feature class from ArcGIS Pro to ArcGIS Online.
- Reorder the fields of the feature class using the Feature Class to Feature Class tool.
- Select the feature class to reorder the fields as the Input Features.
- Set a location for the Output Location.
- Set a name for the Output Feature Class.
- Under the Field Map section, reorder the fields in the Output Fields list by selecting the field to reorder, and dragging it to the desired position.
Note: The capability to drag fields in the Output Fields list is only available in ArcGIS Pro 2.0 and later.
- Click Run. A new feature class is created containing the reordered fields.
Note: OBJECTID and Shape fields are added to the attribute table of the output feature class if the fields do not exist before running the Feature Class to Feature Class tool. This is an expected behaviour. These fields do not persist in the online environment.
- Share the new feature class to ArcGIS Online as a web map or a web layer. The order of the fields is retained when viewed in ArcGIS Online.
Refer to the following document on how to publish a feature layer from ArcGIS Pro to ArcGIS Online, Publish hosted feature layers: Publish from ArcGIS Pro.
- ArcGIS Pro: Attribute field mapping
- ArcGIS Pro: Feature Class to Feature Class
- ArcGIS Pro: Share a web map
- FAQ: Is it possible to sort features based on their spatial location in ArcGIS Pro?