<?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>idea Only export defined tool paramenters from ModelBuilder to python file in ModelBuilder Ideas</title>
    <link>https://community.esri.com/t5/modelbuilder-ideas/only-export-defined-tool-paramenters-from/idi-p/1063419</link>
    <description>&lt;P&gt;When exporting a Model Builder model to a python file, I've found that it includes all tool parameters in the export even if I haven't defined them in the tool. For example (and where I had problems arise), I have used the Alter Field tool in a model to alter the Field Name and sometimes Field Alias. All other options were ignored (they're optional or didn't apply - mainly the Clear Alias option).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LindsayRaabe_FPCWA_2-1622517105707.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/14654iE6DD48313C939211/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LindsayRaabe_FPCWA_2-1622517105707.png" alt="LindsayRaabe_FPCWA_2-1622517105707.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Data_Requests_7_ = arcpy.management.AlterField(in_table=Data_Requests_6_, field="OwnerSname", new_field_name="OwnerS", new_field_alias="", field_type="", field_length=8000, field_is_nullable="NON_NULLABLE", clear_field_alias="DO_NOT_CLEAR")[0]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LindsayRaabe_FPCWA_1-1622517039022.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/14653i52BA4D59BD598008/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LindsayRaabe_FPCWA_1-1622517039022.png" alt="LindsayRaabe_FPCWA_1-1622517039022.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Data_Requests_10_ = arcpy.management.AlterField(in_table=Data_Requests_9_, field="Actual_Start", new_field_name="OpStart", new_field_alias="OpStart", field_type="", field_length=8, field_is_nullable="NON_NULLABLE", clear_field_alias="DO_NOT_CLEAR")[0]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;When I first ran the python script, I found an error occurred because it failed to set the field_is_nullable parameter. Once I deleted the parameters after the new_field_alias option out and ran the model again, it worked fine.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proposal: When exporting a model to python, only include tool parameters that have been purposefully defined, and not just assumed with a default value (above code would appear like the below example).&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Data_Requests_7_ = arcpy.management.AlterField(in_table=Data_Requests_6_, field="OwnerSname", new_field_name="OwnerS")[0]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Data_Requests_10_ = arcpy.management.AlterField(in_table=Data_Requests_9_, field="Actual_Start", new_field_name="OpStart", new_field_alias="OpStart")[0]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 01 Jun 2021 03:19:01 GMT</pubDate>
    <dc:creator>LindsayRaabe_FPCWA</dc:creator>
    <dc:date>2021-06-01T03:19:01Z</dc:date>
    <item>
      <title>Only export defined tool paramenters from ModelBuilder to python file</title>
      <link>https://community.esri.com/t5/modelbuilder-ideas/only-export-defined-tool-paramenters-from/idi-p/1063419</link>
      <description>&lt;P&gt;When exporting a Model Builder model to a python file, I've found that it includes all tool parameters in the export even if I haven't defined them in the tool. For example (and where I had problems arise), I have used the Alter Field tool in a model to alter the Field Name and sometimes Field Alias. All other options were ignored (they're optional or didn't apply - mainly the Clear Alias option).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LindsayRaabe_FPCWA_2-1622517105707.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/14654iE6DD48313C939211/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LindsayRaabe_FPCWA_2-1622517105707.png" alt="LindsayRaabe_FPCWA_2-1622517105707.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Data_Requests_7_ = arcpy.management.AlterField(in_table=Data_Requests_6_, field="OwnerSname", new_field_name="OwnerS", new_field_alias="", field_type="", field_length=8000, field_is_nullable="NON_NULLABLE", clear_field_alias="DO_NOT_CLEAR")[0]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LindsayRaabe_FPCWA_1-1622517039022.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/14653i52BA4D59BD598008/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LindsayRaabe_FPCWA_1-1622517039022.png" alt="LindsayRaabe_FPCWA_1-1622517039022.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Data_Requests_10_ = arcpy.management.AlterField(in_table=Data_Requests_9_, field="Actual_Start", new_field_name="OpStart", new_field_alias="OpStart", field_type="", field_length=8, field_is_nullable="NON_NULLABLE", clear_field_alias="DO_NOT_CLEAR")[0]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;When I first ran the python script, I found an error occurred because it failed to set the field_is_nullable parameter. Once I deleted the parameters after the new_field_alias option out and ran the model again, it worked fine.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proposal: When exporting a model to python, only include tool parameters that have been purposefully defined, and not just assumed with a default value (above code would appear like the below example).&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Data_Requests_7_ = arcpy.management.AlterField(in_table=Data_Requests_6_, field="OwnerSname", new_field_name="OwnerS")[0]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Data_Requests_10_ = arcpy.management.AlterField(in_table=Data_Requests_9_, field="Actual_Start", new_field_name="OpStart", new_field_alias="OpStart")[0]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jun 2021 03:19:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-ideas/only-export-defined-tool-paramenters-from/idi-p/1063419</guid>
      <dc:creator>LindsayRaabe_FPCWA</dc:creator>
      <dc:date>2021-06-01T03:19:01Z</dc:date>
    </item>
  </channel>
</rss>

