I am using ArcGIS 10.2 ModelBuilder with the Field Values iterator to select unique field values. I then want to forward these values to the Add Field tool, to create a new field for each unique value.
The problem I have is that the iterator's output value appears to have a temporary starter value of "1" by default, which is then replaced by the actual values once the model runs. However, the issue is that the Add Field tool throws an error before the model even starts, because it cannot use numbers as inputs for field names, so it remains out of action once the "real" values become available.
How fo I flush-out or replace this starting value of "1"?
The Iterate Field Values tool is correctly set to "String" data type, yet the temporary starter / filler value remains "1".
I've attached a picture of my model and submodel.
I was unable to get it working in ModelBuilder, it is presumably a bug. But I was successful in getting it working via a python script along the lines of the answer listed below.