[GIS] Using Value from Iterate Feature Selection to create new files per feature value

arcgis-desktoparcmaperror-000354iteratormodelbuilder

I am attempting to use Model Builder to export a file per value in a feature. The intent is to create a file per school, listing the students that attend. We currently have a single large file with all students and the school they attend is entered as a number.

Here are the steps I have so far.

Pic of Model

I am iterating through the field WSCHOOLNUM, an Int.
I am sending to the Copy Features which is exporting to StdntsBySchl1415.gdb\Stds_%Value%

I get the following error message:

"_WSCHOOLNUM ""WSCHOOLNUM" = 4" # #

Start Time: Fri Jul 10 12:42:31 2015

ERROR 000354: The name contains invalid characters

Item not found in this collection.

Failed to execute (Make Feature Layer).

Failed at Fri Jul 10 12:42:31 2015 (Elapsed Time: 0.29 seconds)

Failed to execute (Iterate Feature Selection).

Failed at Fri Jul 10 12:42:31 2015 (Elapsed Time: 3.51 seconds)"

I understand tables can't start with a number, but I thought my naming scheme would take care of that.


As suggested below I renamed my origin shapefile to eliminate the hyphen. That did not resolve the issue. I then created a new text field, Field Calculated the integer field to it, and it ran fine, so I guess the issue was with the integers.

Best Answer

I would suggest try using the model only tool parse path to force the name into your copy features tool. You can find the parse path tool under the same menu as the feature selection iterator.

enter image description here

For the parse path tool select name and use the name of the variable for the string variable substitution. Also make it a precondition to copy features. enter image description here

enter image description here

Related Question