Model Builder Entering a Field Name in Calculate Field

1685
3
06-13-2011 10:50 AM
TimFast
New Contributor
I am new to model builder. I have a model which requires the user to enter the field name for  a Calculate Field GP task. My question is how do I set up in Model builder so that when the user starts it it gives him the choice of which Field Name to use for the Calculate Field GP step in the model? Calculate field does not seem to be able to allow the user to enter in a field name.
Here is a screen shot of my model:
0 Kudos
3 Replies
DaleHoneycutt
Occasional Contributor III
You'll need to make a model parameter of the field name.
First, see this topic for a general discussion of how to create model tools: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/A_quick_tour_of_creating_tools_with_Mo...

Secondly, see this topic for information on how to make model variables: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Exposing_tool_parameters_as_variables/...

Then you can make a model parameter of the variable: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Creating_model_parameters/002w0000003z...
0 Kudos
DavidCurtis
New Contributor II
You'll need to make a model parameter of the field name.
First, see this topic for a general discussion of how to create model tools: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/A_quick_tour_of_creating_tools_with_Mo...

Secondly, see this topic for information on how to make model variables: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Exposing_tool_parameters_as_variables/...

Then you can make a model parameter of the variable: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Creating_model_parameters/002w0000003z...



I'm not sure if this answer satisfied the original poster, but I would like to elaborate on the original problem. I'm trying to use a Calculate Field tool after using an Extract Multi Values to Points tool. However, this won't work because the Calculate Field tool doesn't predict the fields that will be created by the Extract Values tool. The Calculate Field tool only has a drop-down that is preloaded with fields that currently exist in the model. Making a model parameter from the Field Name in Calculate Field doesn't work either. Does anyone have a fix for this or am I asking the impossible?
0 Kudos
JamesTitus
New Contributor

I came here looking for an answer to the same question David Curtis asked.  Not knowing whether something like this is possible is what leads me to either create similar but duplicative models, avoid models in favor of python programs that call each tool individually, or break up models into two smaller models just so that a single tool in the middle of the model can be called outside of either model.  

0 Kudos