Select to view content in your preferred language

Model Builder -field names are going nuts

3597
3
08-17-2012 12:40 PM
Labels (1)
ScottWarner1
Deactivated User
I have built a model to run a join between my parcel feature class(parcels) and a table(view1).  If I was to do this join the old fashion way, go to feature class select Join navigate to excel table and join, export to feature class and then open attribute table my field names they would appear to make sense, then I could export them to shp file and they would still make sense maybe be truncated but non-the-less make sense.  Well when I setup Model builder to do this for me for some reason my field names don't turn out the same.  Using Model builder I run the join from there it Copy Features(exports to the FGDB) then it removes the Join.  But when doing this it exports/copies just fine to my GDB but if I go an export this to a shp file all my field names end up having the joined table name first then whatever is left to fit gets added.  So sometimes I end up with view1_P whereas it should have been Parcels.  I do import the tables into the FGDB as dbfs before running the join also and index them.  Someone from ESRI told me to try and use "Maintain Fully Qualified field names" under Make Variable from Environment/Fields when right clicking on the Copy Features but this did not work. 

Any ideas? Or am I not making sense?
0 Kudos
3 Replies
Zeke
by
Honored Contributor
I might be misunderstanding your question, but I think this may be correct behavior. Using the table name as a prefix is a standard used in many db designs, particularly on joins. This is primarily to differentiate field names that may be the same in the original and joined tables. I'm not aware of any setup that does this for just identical field names; it happens for all fields, at least in the joined table(s). The truncation is due to the .dbf files in shapefiles having (I think) a 10 character limit to field names.
0 Kudos
KenCarrier
Deactivated User
I think the reason this might seem different in ArcMap is because it will use the alias when viewing the attribute table.

Something you might consider is creating a blank schema of how you want your data to look(field names and order, etc...), export it to an xml workspace document.

A workflow might go something like this in a model;

1. Perform your join
2. Create File GDB
3. Import XML Workspace document (schema only), 'rename the layer to featureclassname_temp
4. Append data from joined Feature Layer into the featureclass created from previous step, here you can specify field mapping.
5. Delete the old version of featureclass, Rename the _temp version by removing _temp from the naming convention.
6. Now you should have a working featureclass with field names just the way you want.
0 Kudos
Zeke
by
Honored Contributor
As long as the data stays in a gdb field names should be fine, maybe with the table name prepended. If Scott exports to a shapefile as he says, the table will be a .dbf file, which I think is limited to ten (maybe thirteen?) character length field names. He could set up an alias, but can't get around the length limit for a .dbf file.
0 Kudos