<?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 Best Practices: Adding / Calculating many fields in Model Builder? in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/best-practices-adding-calculating-many-fields-in/m-p/181169#M6078</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to create a tax table that has different schema than the source table.&amp;nbsp; Basically I am trying to figure out the cleanest way to 1) Add many fields to a table, 2) calculate the new fields based on the values of the old fields, 3) delete the old fields.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One possible solution that I came across is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Include the add field function in my model&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) Right click on "Add Field" then make variable from parameter and add Field Name, Field Type, and Field Length if necessary&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3) For variable add the number of variables that I want to populate&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4) The add field function will then allow me to add many fields at once.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;5) Repeat steps 2-4 for calculate field.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem that I have is that in my subsequent "delete field" operation It tries delete each field 50 times (once for each new added field).&amp;nbsp; The code doesn't fail, but it is inefficient when it attempts to delete a field multiple times when the field only needs to be deleted once. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My question is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1)&amp;nbsp; Is this the best practice to add and calculate many fields at once in model builder?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2)&amp;nbsp; How can I get Model Builder to stop viewing the table as a list.&amp;nbsp; So that delete field and other operations only try to execute once?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the Image below when I create variables to add fields and calculate fields subsequent operations still recognize the table as a list, which is not wanted&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]14912[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Jun 2012 13:54:05 GMT</pubDate>
    <dc:creator>MarkVolz</dc:creator>
    <dc:date>2012-06-04T13:54:05Z</dc:date>
    <item>
      <title>Best Practices: Adding / Calculating many fields in Model Builder?</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/best-practices-adding-calculating-many-fields-in/m-p/181169#M6078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to create a tax table that has different schema than the source table.&amp;nbsp; Basically I am trying to figure out the cleanest way to 1) Add many fields to a table, 2) calculate the new fields based on the values of the old fields, 3) delete the old fields.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One possible solution that I came across is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Include the add field function in my model&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) Right click on "Add Field" then make variable from parameter and add Field Name, Field Type, and Field Length if necessary&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3) For variable add the number of variables that I want to populate&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4) The add field function will then allow me to add many fields at once.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;5) Repeat steps 2-4 for calculate field.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem that I have is that in my subsequent "delete field" operation It tries delete each field 50 times (once for each new added field).&amp;nbsp; The code doesn't fail, but it is inefficient when it attempts to delete a field multiple times when the field only needs to be deleted once. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My question is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1)&amp;nbsp; Is this the best practice to add and calculate many fields at once in model builder?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2)&amp;nbsp; How can I get Model Builder to stop viewing the table as a list.&amp;nbsp; So that delete field and other operations only try to execute once?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the Image below when I create variables to add fields and calculate fields subsequent operations still recognize the table as a list, which is not wanted&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]14912[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jun 2012 13:54:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/best-practices-adding-calculating-many-fields-in/m-p/181169#M6078</guid>
      <dc:creator>MarkVolz</dc:creator>
      <dc:date>2012-06-04T13:54:05Z</dc:date>
    </item>
  </channel>
</rss>

