Can you use modelbuilder iterators for stand-alone tables?

1410
3
04-28-2017 10:24 AM
AdrienHafner
Occasional Contributor

I'm trying to iterate through a table using the Iterate Row Selection iterator to pull out unique owner values from the table and export each type to their own table.  The model ran once, but instead of making subsets of the data, included the full dataset in each table.  I tried a few other things and reverted the model back to its original (once semi-functioning) state and now it's giving me an error saying that it won't run because there are no OID's in the source data.  I have not changed the source data since the initial model.  Is there any way to use this iterator for stand-alone tabular data?  The data has no spatial component, otherwise I would consider making an XY Event Layer and going from there.   Below are screenshots of the model and the error.

P.S.  I have also tried using both .xls and .csv files for the input with the same result.

Tags (2)
0 Kudos
3 Replies
curtvprice
MVP Esteemed Contributor

Have you tried copying to a geodatabase or .dbf with the Copy Rows tool before trying to iterate on it? You also could try with a Make Table View tool placed before your iterator - but read-only data sources can be slow (and problematic due to file naming issues). Table data sources like also lack OIDs so they have limited functionality for selections and joins. I suspect an XY event layer may have the same problem.

If your model must read from a file, try having the first tool run be a Copy Rows to "in_memory\xxtable" or %scratchGDB%\xxtable (if it is big) and use xxtable for your iteration instead of the file.

curtvprice
MVP Esteemed Contributor

I just tried this using 10.4.1 and had no problems. I have a new theory as to the issue (which would be worked around by taking my advice and copying the table to a database table with the Copy Rows tool). I think your ArcGIS session is confused because I don't see "Monday Pole Owner" in your .csv file name. I am assuming this was the tab name in your excel sheet, and your excel sheet is named the same as your CSV table so all your table view names are colliding in memory. By the way, your tab name with spaces in it is likely to break ArcGIS -- all field names, tab names, and dataset names should not contain spaces, and should always start with a letter. 

So, this may be one of those situations where you should close ArcGIS, reformat your data to not have any spaces in the names, and restart ArcGIS give it another try.

AdrienHafner
Occasional Contributor

Hi Curtis,

Thank you for your suggestions.  I did try renaming the Excel file with no spaces, to no avail.  I got impatient, and rather than using ModelBuilder to add the additional geoprocessing tools and iterator(s), I decided to use FME via the Data Interoperability extension.    Love ArcGIS, but when it gets to be too finicky, FME is always my go-to.  Thanks again!