1

I have the exact same problem as Iterate Through Fields in Model Builder [sic] at GeoNet but all the solutions proposed there involved ArcPy and I'm not familiar with that program. I would like to use ModelBuilder to do the exact same thing: iterate through fields in a polygon shapefile and, for each one, create a raster based on the value in the field.

Any suggestions?

I'm using ArcMap and here's what I have so far.

enter image description here

The error message reads:

ERROR 000728: Field 1 does not exist within table

Failed to execute (Polygon to Raster).

I am trying to iterate through fields, not values of a single field. The shapefile does have some ID fields that are string format though and which I don't want to convert. However, there are 26 Double fields that I do want to convert.

4
  • What happens when you run that model?
    – PolyGeo
    Oct 25, 2020 at 4:20
  • Please use the edit button beneath your question to revise it with any requested clarifications. Is that the entire message? What field are you iterating? What values are in that field?
    – PolyGeo
    Oct 25, 2020 at 4:47
  • 1
    Are you trying to iterate through all the fields in your shapefile, or are you trying to iterate through all the values in a single field of your shapefile?
    – PolyGeo
    Oct 25, 2020 at 4:50
  • @PolyGeo Yes, sorry. I added the error message to the original question. I am trying to iterate through fields, not values of a single field. The shapefile does have some ID fields that are string format though and which I don't want to convert. However, there are 26 Double fields that I do want to convert. Should I drop the string fields? What about the OBJECTID field, which can't be deleted? Oct 25, 2020 at 15:16

1 Answer 1

1

With ArcMap there is no out of the box ModelBuilder tool that iterates over fields, they iterate over rows. As indicated in the comments the way to do this is through some simple Python code which you have dismissed in your question. This leaves you only one option, replicate the tool and set the field parameter to be each of your fields for each tool as shown below.

You give no indication of how many fields you want to convert by, if a few, then it literally takes seconds to set up the model below. If it is hundreds I would be questioning why you have a dataset structured so.

Suggested model

5

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.