I need to iterate all files in one folder/geodatabase, and perform those operations for all files in a different folder/geodatabase i.e. a matrix, of all entries in one, to all entries in another.

ModelBuilder won't permit using two iterators in one model, and I can't seem to get nesting one iterator in a sub-model to work, or two iterators in two sub-models.

Can someone provide a working example?

1 Answer 1


Model estimates employment within each 'bounds' (transit station boundary) for each year of LEHD data. Rather than select which bounds matched which geographically specific LEHD, this model does them all, and the null results drop out. The 'inner' model (inside the 'outer') model iterates over each of the bounds, while the 'outer' model iterates over each year-specific LEHD file.

For some reason, I had to make the output file from the 'inner' model a parameter so it would show up in the 'outer' model and actually get written to disk.

To get the cyan-colored variables, I right-click the iterator hex and used 'make variable'/'from parameter'; I used this for naming files, so they reflected the bound/year combination that generated them. I made a number of things from the 'inner model' (top) variables so they would show up in the outer model. To get 'year' to show up in the inner model (from the outer model), I had to create a variable in the inner model (r-click the white, 'create variable'), and link that up. (Clicking and dragging an arrow to connect didn't work--I couldn't use the variable as text in the inner model). The data type is 'string'.

I think I made WS ('workspace') a variable just for portability. Don't think it's necessary otherwise--it's used to locate the input and output geodatabases.

Yes, the 'make feature layer' is necessary for 'select feature by layer'.

inner model visual outer model visual inner model parameter text outer model parameter text

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.