<?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 How do I add multiple fields to a table in Model Builder ArcGIS 10.4? in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/how-do-i-add-multiple-fields-to-a-table-in-model/m-p/193778#M6615</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am developing a new model for a population profile geoprocessing task. The first step sums a series of variables based on a simple point in polygon routine. I then want to add a new set of field names to the table to create some percentages using Calculate Field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is possible using 'Add Field' but I need to use the tool several times and it is cumbersome as I have a high number of fields to add in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to use an iterator to run Add Field?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;much appreciated&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Justin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Sep 2016 16:05:23 GMT</pubDate>
    <dc:creator>JustinGleeson2</dc:creator>
    <dc:date>2016-09-06T16:05:23Z</dc:date>
    <item>
      <title>How do I add multiple fields to a table in Model Builder ArcGIS 10.4?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-do-i-add-multiple-fields-to-a-table-in-model/m-p/193778#M6615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am developing a new model for a population profile geoprocessing task. The first step sums a series of variables based on a simple point in polygon routine. I then want to add a new set of field names to the table to create some percentages using Calculate Field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is possible using 'Add Field' but I need to use the tool several times and it is cumbersome as I have a high number of fields to add in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to use an iterator to run Add Field?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;much appreciated&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Justin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2016 16:05:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-do-i-add-multiple-fields-to-a-table-in-model/m-p/193778#M6615</guid>
      <dc:creator>JustinGleeson2</dc:creator>
      <dc:date>2016-09-06T16:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add multiple fields to a table in Model Builder ArcGIS 10.4?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-do-i-add-multiple-fields-to-a-table-in-model/m-p/193779#M6616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could use a &lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/tools/modelbuilder-toolbox/for.htm"&gt;For &lt;/A&gt;iterator (e.g. "For 1 to 50" to do something, like Add Field, 50 times [or possible 49 times, depending how it counts]). This would add 50 copies of very similar fields, like all fields of the same type, with incrementing numbers in their names, like "My_Field_1", "My_Field_2", etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or, you could populate a table with your &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/add-field.htm"&gt;Add Field&lt;/A&gt; parameters (columns holding info like field name, field type, etc.) and run the &lt;A href="http://desktop.arcgis.com/en/arcmap/10.3/tools/modelbuilder-toolbox/iterate-row-selection.htm"&gt;Iterate Row Selection&lt;/A&gt; to get those values to use in Add Field, so you could have full control over the types and names of all your new fields.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2016 16:14:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-do-i-add-multiple-fields-to-a-table-in-model/m-p/193779#M6616</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2016-09-06T16:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add multiple fields to a table in Model Builder ArcGIS 10.4?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-do-i-add-multiple-fields-to-a-table-in-model/m-p/193780#M6617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A good pattern is to make a numpy array of typed data and use arcpy.da.ExtentTable to add the fields to your table.&lt;/P&gt;&lt;P&gt;The Python snippet would be in a Calculate Value model tool.&amp;nbsp; An example of syntax is in this GP sample:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://www.arcgis.com/home/item.html?id=da9efbe1232f426ead182213f53c8cd8" title="http://www.arcgis.com/home/item.html?id=da9efbe1232f426ead182213f53c8cd8"&gt;http://www.arcgis.com/home/item.html?id=da9efbe1232f426ead182213f53c8cd8&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2016 16:33:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-do-i-add-multiple-fields-to-a-table-in-model/m-p/193780#M6617</guid>
      <dc:creator>BruceHarold</dc:creator>
      <dc:date>2016-09-06T16:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add multiple fields to a table in Model Builder ArcGIS 10.4?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-do-i-add-multiple-fields-to-a-table-in-model/m-p/193781#M6618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Darren, the Iterate Row Selection seems to be the way to go. I have set this up and it takes it's values from a table with the required parameters in Add Field. I still seem to be running into trouble with it though.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would you have the Iterate Row Selection and Add Field working off a secondary Model within the main Model?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Justin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2016 21:24:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-do-i-add-multiple-fields-to-a-table-in-model/m-p/193781#M6618</guid>
      <dc:creator>JustinGleeson2</dc:creator>
      <dc:date>2016-09-06T21:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add multiple fields to a table in Model Builder ArcGIS 10.4?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/how-do-i-add-multiple-fields-to-a-table-in-model/m-p/193782#M6619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After some different approaches to this I created a simple .py script that updates the table with all the fields I need. See below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;...............................&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;import arcpy &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from arcpy import env &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;env.workspace = r"C:\X\X.gdb" &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;for PopSummary in arcpy.ListTables("*"): &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;try: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.AlterField_management(PopSummary, "Sum_Pop_T11", "", "TotalPop") &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.AlterField_management(PopSummary, "Sum_Pop_014T11", "", "Pop_014")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.AlterField_management(PopSummary, "Sum_Pop_1524T1", "", "Pop_1524")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;except: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pass&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;..............................&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Lot's of other useful way of updating a table using the Fields Toolset within the script - Alter Field, Calculate Field etc&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Sep 2016 17:14:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/how-do-i-add-multiple-fields-to-a-table-in-model/m-p/193782#M6619</guid>
      <dc:creator>JustinGleeson1</dc:creator>
      <dc:date>2016-09-07T17:14:49Z</dc:date>
    </item>
  </channel>
</rss>

