Using ModelBuilder to iterate through a GDB and export all layers to a single layer

878
2
04-08-2021 10:34 AM
JoanneStarr
New Contributor III

I am trying to use model builder to export iterate through a GDB, and export all layers to a single layer. Within my GDB, there are some attributes that are the same across the entire database, I would like to keep only those attributes and drop everything else. I am not sure if this is possible in ModelBuilder or if I have to switch to a python script.

0 Kudos
2 Replies
RobertBorchert
Frequent Contributor III

Hard to really give an answer without seeing the actual data and how many feature classes your talking about.

What I would suggest is creating a new Feature Class that contains all the possible Attributes using the existing field names exactly as they are in the database.  you can simply select all and do a copy paste and it will paste them into the new Feature Class. Then you can go through and perform clean up. 

0 Kudos
DuncanHornby
MVP Notable Contributor

A single tool would achieve this, the Merge tool. You would edit the field mappings parameter to drop fields you have no interest in.

Also merge will only merge FeatureClasses of the same geometry type.

0 Kudos