Get Count Tool with Iterators in Model Builder

3409
5
09-09-2011 05:20 AM
PaulLeonard
New Contributor II
Hello all.
I have the "Get Count Tool" returning number of rows using "Select" tool in a feature class.  This is a precondition for the rest of my model.  So if false it will not continue model.  However, the features class was selected from a folder using "Iterate Features".  When the precondition is false, the model doesn't iterate the next available feature correctly.  It simply gives this error:  "All the inputs are not current" and after giving this error for every feature class in folder, I am left with only empty output.  Clearly I am missing something important here.  Any help? --attached image.

Cheers!
0 Kudos
5 Replies
PaulLeonard
New Contributor II
Okay so I figured out the error message but I still need to do this:

If precondition is 'true' continue the model -- this works.  However, if precondition is 'false' don't stop the model, simply continue iterating the next input.  Could I use a Calculate Value tool to do this?
0 Kudos
ShitijMehta
Esri Regular Contributor
yes you can use the Calculate Value tool like this:

Check this blog
0 Kudos
PaulLeonard
New Contributor II
yes you can use the Calculate Value tool like this:

Check this blog


Thanks for doing this blog.  However, using the calculate value tool in your examples only continues workflow with tools.  I need to feedback workflow into an iterator.  Therefore I can't make the 'false' Calculate Value boolean a precondition to run the iterate feature tool.
0 Kudos
ShitijMehta
Esri Regular Contributor
I am not sure I understand what do you mean by feedback.
Are you trying to use a feedback loop with an iterator?

Are you trying to branch a model based on a true branch and a false branch?

Check if this blog answers your question.
0 Kudos
ShitijMehta
Esri Regular Contributor
Hi Paul,

To suggest a possible solution I need to know:

Why do you want to feed back the output of Get Count tool into the iterator?

If it is false you want to continue processing what?

Get Count tool only gets the count of selected records. If the selection is = 0 what do you want the model to do?
0 Kudos