Using ModelBuilder to create list with all feature classes in geodatabase

arcgis-desktoparcmapesri-geodatabasemodelbuildervalue-list

The goal of what I am trying to achieve is to get a list of all feature classes in every dataset in my geodatabase.

Through following blow URL I could successfully achieve result for one dataset level.
https://desktop.arcgis.com/en/arcmap/10.3/analyze/modelbuilder/integrating-model-within-a-model.htm

enter image description here

I added an other model with dataset iterator to loop through all datasets in my geodatabase and use previous model as a sub model.

enter image description here

Now, as per my understanding in ModelBuilder, for each dataset iteration, the "Output Values" list from sub model will get overwritten.

How can I append the output of the sub model "Output Values" to an other list so at the end I will have a list with all feature classes in geodatabase?

I mean something like "append" or add new records to a list from "Output Values" until dataset iterator finishes.

After having all feature classes list of my geodatabase I can then do with it any geoprocessing that may suit. For example, I can merge all polygon feature classes and erase merge result from area of interest to create a land cover polygon.

Best Answer

I found the answer to use the same logic used with collect values in sub model. I added another collect value in main model and connect it to output from sub model. This way, all feature classes in every dataset will be collected in this list. Now, use this model as sub model.

enter image description here

Related Question