I am running two models using an iterator in each. I want my output (feature class in a GDB) to be named after the field value from which it was selected as opposed to "I_feature1_join1', etc. I run the model on the left to select for unique community names (I want my out put to be named as such).  The model on the right iterates for a spatial join (which model builder won't let me perform in the first model).  I want the feature class names in the final GDB to have name name of the selected feature from the first iterator

1 Answer 1


The answer in Use Get Field Value tool to calculate field? shows how you can accomplish this.

In short, use the Get Field Value help (modelbuilder only tool) on the featureclass in question. Using its output variable name, supply that as an inline variable in your output featureclass parameter. If the GFV param name was called fieldValue, your output FC param would reference it by %fieldValue%

  • Thanks, that really helps. I set up the 'Get Field Value' the plug in 'fieldvalue' into my output feature class but get and error due to 'invalid characters'. The field name has several spaces in them and I assume it counts the space as invalid character. Should I create a new field that removes the spaces and replaces with '_', and what is the formula for that.
    – Ian Horn
    Feb 12, 2016 at 19:47
  • Ya, it sounds like you'll need to do some scrubbing on those names. Either with CalcField or perhaps even a full Python script tool. Though CalcField / CalcValue and some Python should do what you need
    – KHibma
    Feb 12, 2016 at 20:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.