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.
-
Cant you use Pivot table?Bera– Bera2022年01月12日 08:53:14 +00:00Commented Jan 12, 2022 at 8:53
-
1I'd love to use Pivot table @BERA , but it requires an Advance License which I don't have.J_P– J_P2022年01月12日 08:58:21 +00:00Commented 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– radouxju2022年01月12日 10:43:01 +00:00Commented 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– J_P2022年01月17日 03:25:32 +00:00Commented 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– radouxju2022年01月17日 12:59:38 +00:00Commented Jan 17, 2022 at 12:59
1 Answer 1
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.
Explore related questions
See similar questions with these tags.