I am trying to create a model that will iterate through all the files in a Database, return the counts of each feature class, then add them all together to get a final count and put the result in a table. I have created an iterator that goes through the database and summarizes each feature class, but now I want to get a total count of the features.

  • What does your model so far look like?
    – PolyGeo
    Feb 6, 2019 at 12:18
  • A very similar question was asked over on geonet for which I provide an answer.
    – Hornbydd
    Feb 6, 2019 at 13:03
  • Welcome to GIS SE! We're a little different from other sites; this isn't a discussion forum but a Q&A site. Please check out our short tour to learn about our focussed Q&A format.
    – PolyGeo
    Feb 7, 2019 at 0:48
  • 1
    @Hornbydd At GeoNet you said "Modelbuilder and it's standard tools don't offer the ability to insert a row of information into a table which is what you are after." but I think it does by using Calculate Field to write a value into a one row table and then Append-ing that table onto the end of another table created to hold all the values.
    – PolyGeo
    Feb 7, 2019 at 0:51

1 Answer 1


About 10 years ago, before I learned ArcPy where iteration is much easier, which was also before iterators were available in ModelBuilder, I believe I was able to do tasks such as this using ModelBuilder.

I think the keys to doing it now would be:

  1. Prior to iterating have an empty table with a field to hold your counts for each feature class - let's call this ALL_COUNTS
  2. Prior to iterating have a one row table with a field to hold your count for one feature class - let's call this ONE_COUNT - there's no need to have a value in that row because we'll be writing and overwriting its value at each iteration
  3. The schema for All_COUNTS and ONE_COUNT should be identical because we'll be using them in the Append tool
  4. At each iteration use Get Count to count the features and inline substitution to write it into ONE_COUNT via Calculate Field, then Append the current contents of ONE_COUNT onto ALL_COUNTS
  5. Once all iterations are complete use Summary Statistics to SUM the values of ALL_COUNTS

Your Answer

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

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