Issues with Inline Variables in ModelBuilder

1982
2
01-24-2020 08:27 AM
NatalieRobbins
New Contributor III

I am trying to work through several feature classes where I want to select out a certain subset and then save them as a new feature class. I created a model for this but keep getting an error when I use the inline variable %Name% in to rename my new feature class using the Feature Class to Feature Class tool. The error code is 000354, which seems to imply it thinks I am naming the output %Name% instead of it's layer name. 

This is the model tool input for copying the feature class. 

Here is the model in totality:

I have had A LOT of issues with inline substitutions recently, so I am wondering what is going on... Am I not using them properly??

2 Replies
KristinThorpe1
Occasional Contributor

Hi Natalie Robbins! I don't know if you figured out your issue, but I have been using model builder and inline variables lately; here is what I have found. The error may have something to do with the %Name% having spaces or other invalid characters that can't be used in feature class names. For example, if the name of the road is "South St.", the tool is trying to create a feature class name of "South St._Reclass" which is invalid because of the space and period. You have to run the Calculate Value tool with a python script to replace any invalid characters. I'll gladly share a model I am creating if you (or anyone else who sees this thread) are still having this issue.

A question for you if you have found a solution by now, do you find the output name skipping a %Name% and just returning the iteration? I have a model that outputs summary tables for each unique road name. The output name is set up as "PopSum_%Name%" but the first output table is "PopSum_1" when it should be "PopSum_FrostyValley". The second output table is "PopSum_FrostyValley" when it should be "PopSum_I80" and so forth. It's like the inline variable doesn't line up with the unique table value. Any thoughts?

PattiHaggerty
New Contributor III

I also have been having Modelbuilder models that I have used repeatedly in the past fail on inline substitutions recently.  I do all sorts of gyrations but nothing makes them run correctly. I guess I am now giving up and rewriting them directly into python but the iterator & inline sub. approach is so easy when it works correctly.