Export selected features in model builder

11427
3
07-15-2010 07:34 AM
LornaMurison
Occasional Contributor
Hi everyone, I'm running out of things to try here and would appreciate any help 🙂

The first step in my model is to select features and export them.  I use the "make feature layer" tool along with a query to select features.  Then I use the "copy features" tool to make the output permanent.  This step works great.

Final step is to do the same selection as the first step based on the same field, which has been recalculated, export the data, and add and calculate a couple more fields.

If I use make feature layer, copy features, I get an error saying "An expected field was not found or could not be retrieved properly" when it tries to copy features.
Select Layer by Attribute causes the first step to produce this error
Using the "select" tool also produces the same error.

I think this is somehow caused by my adding and calculating fields later on but I don't know why.
0 Kudos
3 Replies
DallasShearer
Occasional Contributor
Are you recreating the feature layer in the final step? If so, are you unsing the same name for the feature layer from step one?
You can try deleting the feature layer then recreating it within the final step.
0 Kudos
LornaMurison
Occasional Contributor
Hi, thanks for the reply,
No, I'm not recreating the same layer, it has a different name and is being saved in a different location.
I've attached a jpeg of the model in case anyone is curious, sorry it seems rather complicated.
Currently I have the problem area set to select, and copy features(2), but select gives me the error "an expected field was not found or could not be retrieved properly".

I also tried running it without any of the add or calculate fields added afterwards and it still gives me the same error.
The query I am using in "select" and the one i used in "make feature layer" (first step which works) is:
[indent] "GoodLake"="yes"[/indent]
and i am querying a file geodatabase, hence the quotes.  The field name is correct, and there are records in the table that have a value of "yes"
0 Kudos
LornaMurison
Occasional Contributor
I think what happened is that while I had planned for the previous output to be saved into a file geodatabase, it was actually being saved into a personal geodatabase.
Make feature layer and copy features is working now.
0 Kudos