Loop through feature datasets in a gdb

7373
11
Jump to solution
02-22-2020 01:27 PM
MalcolmLittle1
New Contributor II

Hello,

Im using modelBuilder to attempt to create polygon datasets for each feature dataset in a geodatabase. Each feature dataset has a set of point feature classes, some for Weekdays (*WD*) and some for Weekends (*WED*):

I want to merge the point feature classes into one (based on wildcard for *WD* or *WED*), then perform a spatial join with an existing polygon feature. This is the model I have constructed so far:

Thing is, whatever I attach to Collect Values, be it a submodel that Iterates Datasets, then feeds that into Iterate Feature Classes, there's no resulting spatially joined polygon feature, or the resulting polygon feature is including everything in the gdb.

What is required to merge just feature classes inside a feature dataset, then loop through a whole geodatabase full of feature datasets?

0 Kudos
11 Replies
MalcolmLittle1
New Contributor II

This worked wonders, thanks.

Is there any modifciation to the code that would allow it to skip past feature datasets that do not have the required data? For instance, some student datasets do not have weekend (WED) feature classes.

0 Kudos
DavidPike
MVP Frequent Contributor

Ah ok I'll throw in a try except block. I guess its erorring on those?

0 Kudos