I am trying to add a table to my content as a hosted layer. It is an excel table that has a column with numeric values stored as text. I did check to make sure that it was a text/string field. AGOL automatically converts the field to 'integer' and I can't find a way to convert it back to string, which I have to do because I want to join the table to a layer using this field. I tried bringing it into arcgis pro first, and arcgis pro recognized it as a string field so I didn't go any further with that idea. I ended up adding a new string field in agol, and copying over the data (i had to do some calculations to add a 0 in front, etc.). But i'm wondering if there is an easier/more straightforward way.
Why doesn't AGOL respect the data types from the original table?
To clarify one thing here - "arcgis pro recognized it as a string field so I didn't go any further with that idea" - you mean recognized it as an Integer field, correct?
My understanding is that ArcGIS automatically determines field type for Excel (.xls) fields based on entries in the column. The workaround here is to save the Excel workbook as a .csv file, the add as an item to ArcGIS Online. When you add the .csv you will be able to specify the field type as string when uploading.
Hope this helps,
Actually, when I added to my ArcGis Pro map, it was listed as string. My problem occurred when I added it to ArcGIS online. That's what I thought was strange. But, I will keep your workaround in mind for the next time. (It would be great if this could be fixed so that one could specify field type when bringing in from excel as well, or at least respecting the field types already designated in excel) Thanks!
I'm having the exact same issue. I have an Excel file that has 2 columns which in Excel read as integer but I need them to be text. I've converted them to a text column and chosen to "ignore error" in Excel so that when I export them to csv or another file type (even Excel) I can use them in a different system and the columns are read as text data type. BUT when I upload them to AGO they are converted back to integer. This has made it impossible to use the join and hosted feature class view option for updating my data through AGO. I had to go back to using desktop tools for doing the join and exporting the data. I'm working at an agency that hasn't yet moved to ArcGIS Pro so it's ArcMap for me. Also when I bring the Excel file into ArcMap it's no problem. The converted columns read as text. This is a big problem!
Saving the Excel file as a CSV before adding to ArcGIS Online will enable you to choose the field type when you upload:
Hope this helps and let me know if it works for you/if you have any other questions.