I have a line or real estate parcel numbers that I cannot import into ArcGIS Online

355
8
08-24-2021 11:41 AM
Labels (1)
BenjaminHooper
New Contributor II

I have a line or real estate parcel numbers that I cannot import into ArcGIS Online without the leading zeros dropping off. Everything seems to be configured right in .txt file but once I import into ArcGIS online, the leading zeros disappear again. Do I need to use the full ArcGIS version to get this accomplished? 

8 Replies
jcarlson
MVP Notable Contributor

This is a common enough question here that you can easily find a few other examples by searching for "leading zero". Basically, when AGOL imports a text-based file like TXT or CSV, it tries to infer the data type for each field when it imports. If it sees nothing but numbers, it's going to treat it as a number, and thereby omit leading zeroes.

During the upload, you should be able to tell it what kind of data each field is. Does setting the parcel number to "text" change anything?

Otherwise, you might consider putting a text character in the parcel number somewhere, then stripping out the extra character later.

Also, does every number have a leading zero? You could simply use the field calculator to add the 0 back after uploading. Even if some numbers start with something else, you could write a field calculation expression to only prepend a 0 on values of a certain length.

- Josh Carlson
Kendall County GIS
BenjaminHooper
New Contributor II

I think the problem is I'm using ArcGIS online and using ArcMaps or other standard desktop versions is just too advanced for me. It doesn't give me the option to set the parcel number to text. It just imports it and configures. the only options I have found to change it are to take out the commas it adds in and to take out the decimal points it adds in but it won't add the zeros back. 

0 Kudos
jcarlson
MVP Notable Contributor

Where are you performing the import? In the map, or in your Content page? I just tested this, and it prompted me for field types when adding the item to my Content.

- Josh Carlson
Kendall County GIS
0 Kudos
BenjaminHooper
New Contributor II

In the map. Should I try it through the content page?

0 Kudos
jcarlson
MVP Notable Contributor

Yes, try it there. In the Map, it's adding the layer as a FeatureCollection, which is just sort of stored in that map's memory. Adding it as a true Item in the content page allows you to have more control over the layer, and gives you the option to add it to more than one map.

- Josh Carlson
Kendall County GIS
BenjaminHooper
New Contributor II

Well it worked, which I greatly appreciate your help on! I spent 6 hours today trying to figure out why 0's were dropping off but I guess that wasn't the problem as to why all my parcels weren't showing up. This is just way too far over my head I guess. But thank you, regardless! While I'm clearly screwing up something else, you solved in 5 mins something I spent 6 hours on! 

0 Kudos
jcarlson
MVP Notable Contributor

Happy to help! Just know that behind my 5 minute solution is plenty of time banging my head against the wall some time in the past.

- Josh Carlson
Kendall County GIS
JayantaPoddar
MVP Esteemed Contributor

You could create a schema.ini file in the same folder as the text/CSV file, and define the desired field as Text.



Think Location
0 Kudos