Select to view content in your preferred language

Model Builder: Field Variable Dropdow from existing Field

274
1
03-09-2026 04:03 AM
GeoFUNKE
Emerging Contributor

Hi,

In A Model, I want to give the user the possibility to relect a field from an input layer that should be used in a Calculat field. (baiscally there ar two options, depending on the input the field that contains teh Attribute is either called "Afield" oder "Bfield".

I wanted to use a Variable of the type field assuming that i have to set a dependency in the Paramteter Settings, but the setting is greyed out for this Parameter.

How can I allow the User to select a field that should be used in "Calculate field"?

 

Best
David

0 Kudos
1 Reply
DanielFox1
Esri Regular Contributor

Hi @GeoFUNKE 

You could try the following:

1. Add the input layer as a model parameter
Right‑click the input layer → Parameter.

2. Add a new model variable of type “Field”

• Model → Insert Variable → Field
• Right‑click the new variable → Properties

Set:

Data Type: Field
Filter: (optional) e.g., String, Long, etc.

3. Connect the field variable to the input layer

• Drag a connection from the input layer to the field variable
• Choose “Fields” as the connection type

4. Make the field variable a model parameter

  • Right‑click → Parameter
  • Now the user will see a dropdown list of fields from the input layer

5. Use the field variable in Calculate Field

Open Calculate Field and insert the field variable into the expression, e.g.

!%FieldName%!

 

This workflow should allow the user to choose a field from that dataset 

0 Kudos