I need the 'New Feature' output to be located in the '1_ExportedFromS" GDB. I cannot get these 2 to "connect" as every time I do so I get an error stating "can only connect a variable to a process."

What type of variable do I need?

The '1_ExportedFromS' GDB is not created until the model has ran, so I cannot enter that path.


The answer to your actual question is to use Inline Variable Substitution (see documentation at http://pro.arcgis.com/en/pro-app/help/analysis/geoprocessing/modelbuilder/inline-variable-substitution.htm for ArcGIS Pro or http://desktop.arcgis.com/en/arcmap/latest/analyze/modelbuilder/examples-of-inline-model-variable-substitution.htm for ArcMap). Basically, you could set the value of "New Feature" to be something like %1_ExportedFromS%\%Name%or %1_ExportedFromS%\Output_%n%. The linked to documentation should hopefully help explain what those values are doing.

But, I see another possible issue with your model. Per the documentation (http://pro.arcgis.com/en/pro-app/help/analysis/geoprocessing/modelbuilder/iterators-for-looping.htm) on use of Iterators in Model Builder:

If an iterator is added to a model, all tools in the model iterate for each value in the iterator. If you do not want to run each tool in the model for each iterated value, create another model and add only the iterator and processes that you want to run multiple times, save it, and add it as a model tool into the main model.

Basically this means every tool, including the Create County Folder and all of the Create File GDB tools in your model will run over and over for every loop of the iterator. If you want it to run Create County Folder and each Create File GDB only once, and you just want it to run clip multiple times via the iterator, then you should look at splitting this up into two models. One model would have just the iterator and clip (and any other steps you want iterated). Then you would add this model as a submodel to the main model (making sure to set input/output parameters for the models as appropriate, including making the 1_ExportedFromS an input parameter to the submodel if you're going to use it in inline variable substitution as noted above). More documentation on using submodels, including in cases of iterators, is available at http://desktop.arcgis.com/en/arcmap/latest/analyze/modelbuilder/integrating-model-within-a-model.htm

  • 1
    Thanks John for the input. You are the second person telling me that it may be better to separate this into 2 models, sounds like that may be the best approach. – Chezel Sep 20 '18 at 15:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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