Iterate Feature Selection Value Unusable for Input In-line Variable Substitution

2355
4
08-20-2013 03:58 PM
JoeChampagne
Occasional Contributor
I've built a model in which I'd like to use an in-line variable substitution from the 'Group by' variable from a Feature Selection iterator. However, Model Builder doesn't appear to pull the value from the input table while editing which invalidates the input parameter for one of my tools. Please see the attached image; note that the indicated value is '1' when the first value from the input features should be '07EE001'. I have also repeatedly verified that valid inputs exist as per: "Z:\Joe_C\BULK_Catchment_Delineation\Stream_Lines\07EE001_PrimaryDirectedNLFlow.shp"

At run-time, the value is extracted and used properly in the output paths of other tools but obviously the invalid tools fail to run at all. I have used this technique successfully with 'Iterate Raster', but no matter what I do this value is unavailable for the validation of my 'Project' tool. Any help would be greatly appreciated!

[ATTACH=CONFIG]26840[/ATTACH]
0 Kudos
4 Replies
DanielHall_Ballester
New Contributor III
Hi Joe,
could you please attach an image of your model.
Thanks
Dan
0 Kudos
JoeChampagne
Occasional Contributor
There IS an image attached... 'Attachment 26840' linked at the bottom of the OP.
0 Kudos
JoeChampagne
Occasional Contributor
I've attempted to re-attach the image from the top post; since I originally posted I was able to work around this issue with Python scripting which ultimately let me build a more robust tool but I still don't understand why this didn't work in the first place.

[ATTACH=CONFIG]29731[/ATTACH]
0 Kudos
DaleHoneycutt
Occasional Contributor III
Did you put quotes around your string in the tool input?  That is:
"%value%_something.shp"

If you did that and it still doesn't work, use Calculate Value.  The expression is "%value%_something.shp", there is no code block, but the output Data Type would be Feature Class.  Use the output of Calculate Value as input to your tool.  What you're doing is "casting" (in programmer terms) the string to a feature class.  But you shouldn't have to do this -- the quoted string should just work.
0 Kudos