Select to view content in your preferred language

Table/fields data types change when added to AGOL

913
5
03-30-2023 07:26 AM
LMBaptista
Frequent Contributor

Hi, all.

I created a survey in LimeSurvey and exported the answers to a xlsx file so I can create a dashboard. In the xlsx file the cells are defined as "General" but the texts appear aligned at left and numbers aligned at right, as normal.

When I load the file to AGOL, most of the fields are assumed as text /when they should be numbers, Integer or double. If I change the data type to integer or double, the features will be deleted. The rows just vanishes.

I tried with a CSV instead of XLSX and the resultass are the same.

I tried load the file to a geodatabase and the data types are ok in the geodatabase, but if I load it to AGOL, the results are still the same.

I changed the header names so they keep below the 10 characters, just in case, and the result keeps the same.

My question is: what can be done so the data types can be correctly assumed by AGOL?

Thanks in advance

PS: I attached an extract of the file so you can test it if you want

0 Kudos
5 Replies
jcarlson
MVP Esteemed Contributor

Tabular datasets don't have explicit datatypes. When AGOL read the file in to create a layer from it, it's essentially reading the whole thing as text and making a best guess about the column based on its contents. (That's what the "analyzing" step means.)

jcarlson_0-1680186907373.png

People often see this happen with things like ZIP codes where the leading 0 is dropped, because the contents suggest "ZIP" to be an integer.

When you publish from a tabular file, AGOL should present you a dialog where you can explicitly tell it what field types you have. It's an optional step, but don't skip it! Adjust your fields here, and your data should load as expected.

jcarlson_1-1680186947853.png

 

- Josh Carlson
Kendall County GIS
0 Kudos
LMBaptista
Frequent Contributor

Thanks for your contribution.

When I change the data type in that step, the features simply disappear. The table become empty.

0 Kudos
jcarlson
MVP Esteemed Contributor

Personally, I would create an empty layer from scratch and explicitly define the data types, then use your file to append data to it. That tends to work better for me.

- Josh Carlson
Kendall County GIS
0 Kudos
LMBaptista
Frequent Contributor

I thought about it but there are almost 300 columns to create. 

I was hoping there is a better and easier way...

0 Kudos
LMBaptista
Frequent Contributor

Any ideas, anyone?

 

0 Kudos