Failure using model builder iteration to append many shapefiles

6718
11
11-01-2011 12:42 PM
JoeCook3
New Contributor II
I have a very simple model set up with the goal of mining many shapefiles from nested folders and appending them into one shapefile. I am using the Iterate Feature Classes Iterator (recursive) to parse through the folders and feed the shapefiles into the Append tool. There are some columns in some of the shapefiles that are not used/do not match up so I'm using the "no test" option in Append to auto match the columns that can be matched. Using this setup I am getting all the shapefiles appended onto my target shapefile and the points plot on the map in the correct location but all the appended values are zero.

If I run the Append tool by itself using the same parameters for a handful of shapefiles it works fine. There is something I am missing between setting up the iterator and transferring the field values into the target shapefile. Is there a different iterator I should be using? I have tried iterate files and a couple other methods but nothing will let me run the append tool successfully other than Iterate Feature Classes.

I plan on using model builder for many upcoming tasks so I'd like to put in the time to understand how it works. Any help is appreciated.
0 Kudos
11 Replies
JoeBryant2
Occasional Contributor II

I also am seeing this behavior when using the Append tool at the end of a Model Builder sequence. The first time I run the model, the attributes are transferred to the fields mapped using NO_TEST. But when I try to run the model a second time on different inputs, only the spatial information is appended.

I am not using an iterator, but instead have parameters assigned to the inputs to manually select the table I have created for joining to a specific area within our district each time I run the tool.

At first I thought this may have something to do with appending from a local file geodatabase to a versioned enterprise geodatabase. So I created an empty local feature class in the same file geodatabase as my tables and intermediate feature classes, using the schema from the destination feature class in SDE. However, the append tool still behaves the same way - the first run is fine, but subsequent runs only append the spatial attributes without giving any indication of errors or warnings in the results.

0 Kudos
curtvprice
MVP Esteemed Contributor

My guess it the field map is being set by parameter validation the first time, and when you try run it again the previously set up field map is used -- but it now out of synch with the inputs. You may try creating a parameter of type field map (right click the append tool, create element from parameter FieldMap, open it up and delete all the entries), and make sure it is empty so every run of the Append tool will start with a clean empty field map so a default fieldmap is generated each run.

append with blank field map

0 Kudos