PROBLEM
In some instances, publishing a CSV file as a hosted feature layer to ArcGIS Online converts an integer field type to a string field. In this example, the 'Number_of_Employees' field type is set to integer when being published to ArcGIS Online.
However, when viewing the hosted feature layer in the Data tab, the field type for the 'Number_of_Employees' field is converted to string instead, as shown in the image below.
This issue occurs if the integer field contains string values. Since a CSV file does not store field type information, each field is automatically assigned a field type based on the field values when publishing to ArcGIS Online. Refer to Esri Newsroom: Make More Useful Layers from CSV Files for more information.
In this example, the 'Number_of_Employees' field contains two string values, 'Five thousand' and 'Nine thousand'. Therefore, the field type was assigned to string instead of integer.
To retain the integer field type in a published hosted feature layer, change the string values in the integer field of the CSV file to integer values using the steps below:
Note: Adding and publishing content as a hosted feature layer to ArcGIS Online requires a Publisher or an Administrator role.
Note: Remove other unnecessary string values such as periods or quotation marks, if any.
Get help from ArcGIS experts
Download the Esri Support App