Model Builder Collect Values tool empty results problem

436
7
09-14-2021 02:37 AM
HilalAl-Rajhi
New Contributor II

I am creating model that merges all polygon feature classes into one feature class. I am using feature class iterator to feed collect value tool list. When dataset has polygons it work fine. But when there is no polygons in dataset it always retrieve one invalid record as "gdb/Dataset/FeatureClass". Of course gdb url and dataset and correct, except that FeatureClass is not valid. So when I get the list and try to merge this list it throws error of invalid parameter. How can I avoid adding this record to my list?

0 Kudos
7 Replies
DanPatterson
MVP Esteemed Contributor

Are you iterating and specifying the feature type to collect as in the demo?

Iterate Feature Classes (ModelBuilder)—ArcGIS Pro | Documentation

Do you branch using if-else syntax if collect values is none?


... sort of retired...
0 Kudos
HilalAl-Rajhi
New Contributor II

Yes Mr. Dan, it is sort of like that, but I am iterating through dataset not workspace level.

I will try do branching and see outcome.

0 Kudos
HilalAl-Rajhi
New Contributor II

Most of my datasets has polygons feature classes, except for one that makes the problem

0 Kudos
HilalAl-Rajhi
New Contributor II

Here is a snapshot of the issue:

featture class.png

0 Kudos
DanPatterson
MVP Esteemed Contributor

You will need to check for that then with the filter "Feature type" set to Polygon as in the link I sent

Iterate Feature Classes (ModelBuilder)—ArcGIS Pro | Documentation


... sort of retired...
0 Kudos
HilalAl-Rajhi
New Contributor II

Would you please Mr. Dan send  sample model demonstrating that. I really couldn't grasp the idea. Thanks

0 Kudos
HilalAl-Rajhi
New Contributor II

I am still struggling with this incase someone has an idea. Thanks in adavance

0 Kudos