1

I'm trying to use the Iterate Row Selection function to collect values from one feature, and then create a series of new Fields in another feature using the collected values as Field Names. There will be a different number of values each time this tool is run.

Any tips on how to build the model to run this successfully?

Each time I try it I only get one value being returned and a single field created

I need to do this in ModelBuilder as this will be a repeated task going forward.

I'm struggling with the Add Field + Field Name component and the Iterate Row Selection function as I try to build out the field names from the Values.

UPDATE: the iterator Value was coming out as an integer, and the Add Field tool would not accept a field name that starts with a number. However, by using "%Value%" instead, and making the connector a precondition the model now works.

starting attribute table -> desired attribute table

Working Model

Successful model

6
  • Cant you use Pivot table?
    – Bera
    Commented Jan 12, 2022 at 8:53
  • 1
    I'd love to use Pivot table @BERA , but it requires an Advance License which I don't have.
    – J_P
    Commented Jan 12, 2022 at 8:58
  • have you tried to directly connect "Value" to "Add Field" ? Also note that model builder works with only one iterator, therefore I recommand that you move to Python script.
    – radouxju
    Commented Jan 12, 2022 at 10:43
  • Good suggestion @radouxju. I was trying that and it was failing as the Value was coming out as an integer, and the Add Field would not accept a field name that starts with a number. However, by using "%Value%" instead, and make the connector a precondition the model now works. See updated question for screenshot.
    – J_P
    Commented Jan 17, 2022 at 3:25
  • thank you for updating your question with the solution. In order to make it more useful to the community, it would be nice to add your update as an answer to your own question.
    – radouxju
    Commented Jan 17, 2022 at 12:59

1 Answer 1

0

the iterator Value was coming out as an integer, and the Add Field tool would not accept a field name that starts with a number. However, by using "%Value%" instead, and making the connector a precondition the model now works. Successful model screen shot shared as part of the original question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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