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

asked Jan 12, 2022 at 8:15
6
  • Cant you use Pivot table? 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. 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. 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. 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. 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.

answered Jan 21, 2022 at 1:02

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.