I have a folder which contains a number of file gdbs. These gdbs all have the same structure i.e. a feature dataset FD_1 and several feature classes within the dataset (the two I am interested in are FC1 and FC2). The feature classes all have the same names within the gdbs.

I want to create tables from the feature classes, so my model does the following:
Iterate Workspaces produces Workspace (the path of the current gdb) and Name (the name of the current gdb). The Copy Rows tool is used to produce a table for FC1. The input table is specified using inline variable substitution

%Workspace%\FD_1\FC1

As is the output table

%Output%\table1_%Name%.dbf

The problem is, the Copy Rows process is not executing. The model simply iterates over the gdbs and then ends. When I check the Copy Rows window, it says that the input table does not exist. I tried setting Workspace as the Current Environment for the tool, but it didn't change anything.

2 Answers
2

Trying to do the same thing, no luck either. The issues seems to be the 'iteratate workspaces'--it doesn't work as you'd expect, iterating over each folder in the directory. Thinking it's for renaming folders, and not much else.

You might try building most of your prcessess into a model, and then inputting the workspace as a multi-value.

What you are asking can be achieved in model builder, you need to create a sub-model. Also your current logic fails as you end up overwriting everything. I discuss that later.

The scenario as you describe is this:

So your master model would be this:

The Sub model would be this:

Iterate Features must have recursive ticked on to get to the FeatureClasses in the FeatureDatasets

Copy the rows into an IN_MEMORY workspace, at this point you will have set the table name

Use Table to dBase tool to save out tables to dBase, this tool resolves issues with field names.

Your current logic will simply overwrite the output tables so you need to give them a unique name as they are all the same names in their geodatabases. You can achieve this when you copy the rows to in_memory by using the output name in_memory\%Name%_%nameFC%. This concatenates the geodatabase it came from with its FeatureClass name.