anyone having trouble entering multiple fields for a feature in ArcCatalog?

901
6
08-21-2017 01:33 PM
RichardCourtney
New Contributor II

I used to be able to create a new shapefile feature in ArcCatalog and setup all the needed fields.  I can't seem to do this in ArcCatalog 10.5.1.  I get a "Unable to alter field's length" error for all new fields except the first.  This used to be a faster way than editing an attribute table from within ArcMap. 

Anyone else have a similar problem?

0 Kudos
6 Replies
RebeccaStrauch__GISP
MVP Emeritus

How are you adding the new fields?  manually or thru a script.  Just a wild guess, but chck to make sure you field names AND aliases are all unique and do not have and unique characters in the field name, and because it is a shapefile, that the file names are not too long, which may cause them to truncate (and possibly be seen as the same field name).

these are just a few things to check.  If you are doing it with a python script, try adding a few of the fields "manually" using the tool instead (not the python window), then copy the results to you script and make sure the formatting of the tool did not change any.

if these tips don't help, can you provide a few more details and the script, if one is being used and follow https://community.esri.com/people/curtvprice/blog/2014/09/25/posting-code-blocks-in-the-new-geonet?s...

RichardCourtney
New Contributor II

Rebecca,

Thanks for getting back to me.

I am in ArcCatalog 10.5.1 where I create a new shapefile (with projection) and I go to add fields to the attribute table. I can get the first field in every time.

When I go to add the second field, regardless of the field name length5 characters for State, for instanceArcCatalog gives me the following error message.

I don’t recall having this difficulty prior to 10.5.

I have seen ArcCatalog warn me about field name lengths, but it would offer a truncated version. None of the names have been duplicates, so I don’t see that as the issue.

I wish this worked like used to as I have students do this in my cartography course. It doesn’t go well in a classroom setting when steps don’t work like they are supposed to.

Any ideas?

R. Courtney

Richard S. Courtney Ph.D. | Chairman, Department of Geography

Kutztown University of Pennsylvania

105 Graduate Center | PO Box 730 | Kutztown, PA 19530

Phone: 610-683-4364 | Fax: 610-683-4941

faculty.kutztown.edu/courtney<http://faculty.kutztown.edu/courtney>

0 Kudos
RebeccaStrauch__GISP
MVP Emeritus

Sorry I haven't responded...I was out of the office last week.

So, I'm running thru the steps I think you ran thru using 10.5.1.  In ArcCatalog, right-click on a folder (make sure it is not a fgdb folder) and select New->Shapefile   I was able to add City and Statge and change the length as I added them

you could also do use the Add Field tool

And if you wanted to get fancied and more consistent, you could write a simple script and custom tool that prompted them for the new Shapefile name, and output folder (so they could write it to their own custom folder for example) and have it set up the whole things...then you could show them the script to teach them simple programming.  just a thought.

As mentioned in my first post, you can grab a copy of the code from the Results tab (open with  Geoprocessing->Results).  Expand the Current Session (or previous, depending when you ran it), right click and copy as python snippet. 

   

arcpy.AddField_management(in_table="D:/_temp/testAddMoreFields.shp", field_name="statecode", field_type="TEXT", field_precision="", field_scale="", field_length="2", field_alias="", field_is_nullable="NULLABLE", field_is_required="NON_REQUIRED", field_domain="")

Anyway, just some suggestions.  But if you are sure you are copying the shapefile into a good folder (not a file gdb folder) and you are altering the length as you ADD the field (you may not be able to alter once it is created...in that case drop and add is better option) and you are still having issues, zip up the shapefile and I (or someone else here) can take a quick look....or contact tech support if you have maintenance and are a contact for your org.

0 Kudos
RichardCourtney
New Contributor II

Rebecca,

I have found out a bit more.

All along I have been working in a properly named folder, not a geodatabase.

I have successfully added several fields to a new file being careful to make no mistakes. If, however, I try to add a field that has too many characters, ArcCatalog will offer to truncate the name, but it will not be able to add the corrected field. At that point, no other fields are accepted. ArcCatalog seems not to forgive mistakes, and students will make plenty of mistakes.

I wish to avoid running scripts for this process. I want students to be able to create new files when needed using ArcCatalog. This way they should have control over location, type, projection, and fields.

Try making a mistake and see what happens for you, I’d be interested to know.

Thanks.

R. Courtney

Richard S. Courtney Ph.D. | Chairman, Department of Geography

Kutztown University of Pennsylvania

105 Graduate Center | PO Box 730 | Kutztown, PA 19530

Phone: 610-683-4364 | Fax: 610-683-4941

faculty.kutztown.edu/courtney<http://faculty.kutztown.edu/courtney>

0 Kudos
RichardCourtney
New Contributor II

Another try.

This time I was in ArcMap and opened Catalog. I added a new shapefile and used Catalog to add fields. I added two correctly, and then entered a field that was too long. ArcCatalog successfully truncated and added the field name. After that, I could not add more fields. I get the same error I first reported.

I do not find my ArcCatalog work showing up in Geoprocessing results

rSc

Richard S. Courtney Ph.D. | Chairman, Department of Geography

Kutztown University of Pennsylvania

105 Graduate Center | PO Box 730 | Kutztown, PA 19530

Phone: 610-683-4364 | Fax: 610-683-4941

faculty.kutztown.edu/courtney<http://faculty.kutztown.edu/courtney>

0 Kudos
by Anonymous User
Not applicable

Did you ever find a solution to this issue? If not I would recommend contacting Support to get a case created. Please let me know if you need assistance.

http://support.esri.com/en/contact-tech-support