<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Batch Add Fields, Model Builder in ModelBuilder Questions</title>
    <link>https://community.esri.com/t5/modelbuilder-questions/batch-add-fields-model-builder/m-p/879307#M3313</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes. Within the model builder. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Feb 2015 17:50:56 GMT</pubDate>
    <dc:creator>Randy_A_Stapleton</dc:creator>
    <dc:date>2015-02-09T17:50:56Z</dc:date>
    <item>
      <title>Batch Add Fields, Model Builder</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/batch-add-fields-model-builder/m-p/879303#M3309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All, &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone suggest a better way to batch add fields using the model builder? See attached image.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2015 15:00:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/batch-add-fields-model-builder/m-p/879303#M3309</guid>
      <dc:creator>Randy_A_Stapleton</dc:creator>
      <dc:date>2015-02-09T15:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Add Fields, Model Builder</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/batch-add-fields-model-builder/m-p/879304#M3310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Randy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you tried to batch add fields by right clicking the Add Field Tool in the Data Management Tools&amp;gt;Fields Toolset?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2015 15:14:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/batch-add-fields-model-builder/m-p/879304#M3310</guid>
      <dc:creator>HabG_</dc:creator>
      <dc:date>2015-02-09T15:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Add Fields, Model Builder</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/batch-add-fields-model-builder/m-p/879305#M3311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think he wants it within the model builder, not doing it manually.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2015 15:16:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/batch-add-fields-model-builder/m-p/879305#M3311</guid>
      <dc:creator>TimWitt2</dc:creator>
      <dc:date>2015-02-09T15:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Add Fields, Model Builder</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/batch-add-fields-model-builder/m-p/879306#M3312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My first thought is to use Python and &lt;A href="http://resources.arcgis.com/en/help/main/10.2/0017/001700000047000000.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;arcpy.AddField_management()&lt;/A&gt;. This assumes all the fields are the same type and length. If they are all different, it can still be done but the code would have to be changed a bit.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy

testtable = r"C:\temp\mygdb.gdb\Test"

newfields = [
&amp;nbsp;&amp;nbsp;&amp;nbsp; "Test1",
&amp;nbsp;&amp;nbsp;&amp;nbsp; "Test2",
&amp;nbsp;&amp;nbsp;&amp;nbsp; "Test3",
&amp;nbsp;&amp;nbsp;&amp;nbsp; "Test4",
&amp;nbsp;&amp;nbsp;&amp;nbsp; "Test5"
]

for field in newfields:
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddField_management(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; testtable,&amp;nbsp; ## in_table
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; field,&amp;nbsp; ## field_name
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "TEXT",&amp;nbsp; ## field_type
&amp;nbsp;&amp;nbsp;&amp;nbsp; )
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "{} added".format(field)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 11:04:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/batch-add-fields-model-builder/m-p/879306#M3312</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-12-12T11:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Add Fields, Model Builder</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/batch-add-fields-model-builder/m-p/879307#M3313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes. Within the model builder. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2015 17:50:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/batch-add-fields-model-builder/m-p/879307#M3313</guid>
      <dc:creator>Randy_A_Stapleton</dc:creator>
      <dc:date>2015-02-09T17:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Add Fields, Model Builder</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/batch-add-fields-model-builder/m-p/879308#M3314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can start with the Add Field tool in a Model, right-click the tool and Make Variable - From Parameter. Field Name would be the first one you need. Open it's Properties and set to List of Values. Open the Parameter and you can do all kinds of interesting things like Insert values from a table...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add any other Variables from Parameters as needed to accommodate different field design across fields.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2015 18:15:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/batch-add-fields-model-builder/m-p/879308#M3314</guid>
      <dc:creator>ToddPayne1</dc:creator>
      <dc:date>2015-02-09T18:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Add Fields, Model Builder</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/batch-add-fields-model-builder/m-p/879309#M3315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not too experienced with Model Builder and I didn't know about this. Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2015 18:28:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/batch-add-fields-model-builder/m-p/879309#M3315</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2015-02-09T18:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Add Fields, Model Builder</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/batch-add-fields-model-builder/m-p/879310#M3316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What I like is with a List of Values, you only need one Add Field tool in the Model.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2015 18:34:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/batch-add-fields-model-builder/m-p/879310#M3316</guid>
      <dc:creator>ToddPayne1</dc:creator>
      <dc:date>2015-02-09T18:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Add Fields, Model Builder</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/batch-add-fields-model-builder/m-p/879311#M3317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you. This is what my model looks like now. &lt;IMG __jive_id="60145" alt="Batch_AddField_02.PNG" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/60145_Batch_AddField_02.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2015 18:53:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/batch-add-fields-model-builder/m-p/879311#M3317</guid>
      <dc:creator>Randy_A_Stapleton</dc:creator>
      <dc:date>2015-02-09T18:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Add Fields, Model Builder</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/batch-add-fields-model-builder/m-p/879312#M3318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This shows that 4 additional field were created. &lt;IMG alt="Batch_AddField_03.PNG" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/60359_Batch_AddField_03.PNG" style="width: 620px; height: 482px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2015 18:56:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/batch-add-fields-model-builder/m-p/879312#M3318</guid>
      <dc:creator>Randy_A_Stapleton</dc:creator>
      <dc:date>2015-02-09T18:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Add Fields, Model Builder</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/batch-add-fields-model-builder/m-p/879313#M3319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes. I wanted to simplify my model. Thanks, Todd. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2015 19:04:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/batch-add-fields-model-builder/m-p/879313#M3319</guid>
      <dc:creator>Randy_A_Stapleton</dc:creator>
      <dc:date>2015-02-09T19:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Add Fields, Model Builder</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/batch-add-fields-model-builder/m-p/879314#M3320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sure thing. GeoNet is cool!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2015 19:10:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/batch-add-fields-model-builder/m-p/879314#M3320</guid>
      <dc:creator>ToddPayne1</dc:creator>
      <dc:date>2015-02-09T19:10:16Z</dc:date>
    </item>
  </channel>
</rss>

