<?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: Formatting parameters for a field reordering tool in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/formatting-parameters-for-a-field-reordering-tool/m-p/645544#M50325</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dave,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I downloaded your script and set it up on some of my sample test data set.&amp;nbsp; Instead of posting screenshots of my field names, I included your field mappings below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first item is to update your python code line 58 to be a blank list:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14688494783322745 jive_text_macro" data-renderedposition="186.17897033691406_7.997159004211426_1332_15" jivemacro_uid="_14688494783322745"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;new_field_order = [&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;]&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a new toolbox =&amp;gt; Right click =&amp;gt; add =&amp;gt; script.&amp;nbsp; Find your script in your file directory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set your script properties to mimic your variable name, and set to string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="212098" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/212098_pastedImage_6.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you input multiple field names as a string in the script window, make sure you enter the values separated by a semi-colon, single quotes enclosed:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'ZIP4;NAME;TYPE;ADDRESS;CITY;ZIP5;STATE;TYPE2;PHONE'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000; background-color: #f6f6f6;"&gt;&lt;IMG __jive_id="212186" class="image-2 jive-image" height="269" src="https://community.esri.com/legacyfs/online/212186_pastedImage_7.png" style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;" width="757" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will run your script properly from a script in a toolbox.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reference:&lt;/P&gt;&lt;P&gt;"As A String"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://pro.arcgis.com/en/pro-app/arcpy/get-started/working-with-multivalue-inputs.htm" title="http://pro.arcgis.com/en/pro-app/arcpy/get-started/working-with-multivalue-inputs.htm"&gt;Working with multivalue inputs—ArcPy Get Started | ArcGIS for Desktop&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In addition, you could certainly read in all field attributes and select them to a variable.&amp;nbsp; Have another variable look through this multi value list or string, then utilize this to create your field mapping.&amp;nbsp; I'll try and post an example when I have a little more time to help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Jul 2016 13:53:54 GMT</pubDate>
    <dc:creator>AlexanderBrown5</dc:creator>
    <dc:date>2016-07-18T13:53:54Z</dc:date>
    <item>
      <title>Formatting parameters for a field reordering tool</title>
      <link>https://community.esri.com/t5/python-questions/formatting-parameters-for-a-field-reordering-tool/m-p/645543#M50324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to make a script tool that reorders the fields in an attribute table and exports a new shapefile with the updated field order. I found a previous discussion (&lt;A href="http://gis.stackexchange.com/questions/32310/how-to-re-order-fields-permanently-using-arcgis-make-query-table-tool" title="http://gis.stackexchange.com/questions/32310/how-to-re-order-fields-permanently-using-arcgis-make-query-table-tool" rel="nofollow noopener noreferrer" target="_blank"&gt;arctoolbox - How to re-order fields permanently using ArcGIS Make Query Table tool? - Geographic Information Systems Sta…&lt;/A&gt; ) with code that used the Merge tool to accomplish this, and when I hardcoded it for a test shapefile, it worked well (despite having to list out the fields in the order desired in a string - line 59). In making a script tool, I'm not sure how to set the parameter to define new_field_order. I tried setting the parameter as a string, but am getting the exception in line 38 raised. How do I set this parameter to read a user-defined order for the fields in the same way I hardcoded it? Also, is there any way to reorder the fields in a temporary attribute table in ArcMap, write code to read the temporary order, and use that order to export the new shapefile (in order to avoid having to type out the desired order)?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy


def reorder_fields(table, out_table, field_order, add_missing=True):
&amp;nbsp;&amp;nbsp;&amp;nbsp; """ 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Reorders fields in input featureclass/table
&amp;nbsp;&amp;nbsp;&amp;nbsp; :table:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input table (fc, table, layer, etc)
&amp;nbsp;&amp;nbsp;&amp;nbsp; :out_table:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output table (fc, table, layer, etc)
&amp;nbsp;&amp;nbsp;&amp;nbsp; :field_order:&amp;nbsp;&amp;nbsp; order of fields (objectid, shape not necessary)
&amp;nbsp;&amp;nbsp;&amp;nbsp; :add_missing:&amp;nbsp;&amp;nbsp; add missing fields to end if True (leave out if False)
&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;gt; path to output table
&amp;nbsp;&amp;nbsp;&amp;nbsp; """
&amp;nbsp;&amp;nbsp;&amp;nbsp; existing_fields = arcpy.ListFields(table)
&amp;nbsp;&amp;nbsp;&amp;nbsp; existing_field_names = [field.name for field in existing_fields]


&amp;nbsp;&amp;nbsp;&amp;nbsp; existing_mapping = arcpy.FieldMappings()
&amp;nbsp;&amp;nbsp;&amp;nbsp; existing_mapping.addTable(table)


&amp;nbsp;&amp;nbsp;&amp;nbsp; new_mapping = arcpy.FieldMappings()


&amp;nbsp;&amp;nbsp;&amp;nbsp; def add_mapping(field_name):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mapping_index = existing_mapping.findFieldMapIndex(field_name)


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # required fields (OBJECTID, etc) will not be in existing mappings
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # they are added automatically
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if mapping_index != -1:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; field_map = existing_mapping.fieldMappings[mapping_index]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new_mapping.addFieldMap(field_map)


&amp;nbsp;&amp;nbsp;&amp;nbsp; # add user fields from field_order
&amp;nbsp;&amp;nbsp;&amp;nbsp; for field_name in field_order:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if field_name not in existing_field_names:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise Exception("Field: {0} not in {1}".format(field_name, table))


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; add_mapping(field_name)


&amp;nbsp;&amp;nbsp;&amp;nbsp; # add missing fields at end
&amp;nbsp;&amp;nbsp;&amp;nbsp; if add_missing:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; missing_fields = [f for f in existing_field_names if f not in field_order]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for field_name in missing_fields:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; add_mapping(field_name)


&amp;nbsp;&amp;nbsp;&amp;nbsp; # use merge with single input just to use new field_mappings
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Merge_management(table, out_table, new_mapping)
&amp;nbsp;&amp;nbsp;&amp;nbsp; return out_table


intable = r"Y:\Huggins_D\2016\Tool\Export_Output.shp"
outtable = r"Y:\Huggins_D\2016\Tool\Export_Output_TEST.shp"
new_field_order = ['ZIP4', 'NAME', 'TYPE', 'ADDRESS', 'CITY', 'ZIP5', 'STATE' ,'TYPE2', 'PHONE']
reorder_fields(intable, outtable, new_field_order, add_missing=True)
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:24:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/formatting-parameters-for-a-field-reordering-tool/m-p/645543#M50324</guid>
      <dc:creator>DavidHuggins</dc:creator>
      <dc:date>2021-12-12T03:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting parameters for a field reordering tool</title>
      <link>https://community.esri.com/t5/python-questions/formatting-parameters-for-a-field-reordering-tool/m-p/645544#M50325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dave,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I downloaded your script and set it up on some of my sample test data set.&amp;nbsp; Instead of posting screenshots of my field names, I included your field mappings below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first item is to update your python code line 58 to be a blank list:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14688494783322745 jive_text_macro" data-renderedposition="186.17897033691406_7.997159004211426_1332_15" jivemacro_uid="_14688494783322745"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;new_field_order = [&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; background-color: inherit;"&gt;]&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a new toolbox =&amp;gt; Right click =&amp;gt; add =&amp;gt; script.&amp;nbsp; Find your script in your file directory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set your script properties to mimic your variable name, and set to string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="212098" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/212098_pastedImage_6.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you input multiple field names as a string in the script window, make sure you enter the values separated by a semi-colon, single quotes enclosed:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'ZIP4;NAME;TYPE;ADDRESS;CITY;ZIP5;STATE;TYPE2;PHONE'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000; background-color: #f6f6f6;"&gt;&lt;IMG __jive_id="212186" class="image-2 jive-image" height="269" src="https://community.esri.com/legacyfs/online/212186_pastedImage_7.png" style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;" width="757" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will run your script properly from a script in a toolbox.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reference:&lt;/P&gt;&lt;P&gt;"As A String"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://pro.arcgis.com/en/pro-app/arcpy/get-started/working-with-multivalue-inputs.htm" title="http://pro.arcgis.com/en/pro-app/arcpy/get-started/working-with-multivalue-inputs.htm"&gt;Working with multivalue inputs—ArcPy Get Started | ArcGIS for Desktop&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In addition, you could certainly read in all field attributes and select them to a variable.&amp;nbsp; Have another variable look through this multi value list or string, then utilize this to create your field mapping.&amp;nbsp; I'll try and post an example when I have a little more time to help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jul 2016 13:53:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/formatting-parameters-for-a-field-reordering-tool/m-p/645544#M50325</guid>
      <dc:creator>AlexanderBrown5</dc:creator>
      <dc:date>2016-07-18T13:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting parameters for a field reordering tool</title>
      <link>https://community.esri.com/t5/python-questions/formatting-parameters-for-a-field-reordering-tool/m-p/645545#M50326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the response Alex!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I tried creating the empty list by replacing line 58, however, it did not appear to have an updated field order&lt;IMG alt="FieldTool.jpg" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/212192_FieldTool.jpg" style="width: 620px; height: 194px;" /&gt;&lt;/P&gt;&lt;P&gt;It was working when I ran the just the script, but it does not appear to be setting that parameter correctly. The output was identical to the input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I would like to set the input and output as parameters as well&lt;/P&gt;&lt;P&gt;ex:&lt;/P&gt;&lt;P&gt;intable = arcpy.GetParameterAsText(0)&lt;/P&gt;&lt;P&gt;outtable = arcpy.GetParameterAsText(1)&lt;/P&gt;&lt;P&gt;new_field_order = []&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then write in the field order as a string depending on the shapefile input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for the help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jul 2016 14:21:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/formatting-parameters-for-a-field-reordering-tool/m-p/645545#M50326</guid>
      <dc:creator>DavidHuggins</dc:creator>
      <dc:date>2016-07-18T14:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting parameters for a field reordering tool</title>
      <link>https://community.esri.com/t5/python-questions/formatting-parameters-for-a-field-reordering-tool/m-p/645546#M50327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can relate to your frustrations.&amp;nbsp; I am also experiencing some major inconsistencies with running it through a toolbox; it worked flawlessly a number of times, but now, for some odd reason, it is not re ordering the fields anymore. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Running this strictly through python works every time, but I cannot explain why the variables are not getting passed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll post again when I have additional time to test.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~Alex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jul 2016 17:20:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/formatting-parameters-for-a-field-reordering-tool/m-p/645546#M50327</guid>
      <dc:creator>AlexanderBrown5</dc:creator>
      <dc:date>2016-07-18T17:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting parameters for a field reordering tool</title>
      <link>https://community.esri.com/t5/python-questions/formatting-parameters-for-a-field-reordering-tool/m-p/645547#M50328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alex,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yeah that's where I was at too. Thank you for taking a look, appreciate the help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jul 2016 17:23:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/formatting-parameters-for-a-field-reordering-tool/m-p/645547#M50328</guid>
      <dc:creator>DavidHuggins</dc:creator>
      <dc:date>2016-07-18T17:23:31Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting parameters for a field reordering tool</title>
      <link>https://community.esri.com/t5/python-questions/formatting-parameters-for-a-field-reordering-tool/m-p/645548#M50329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I changed the bottom of your script to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #808080;"&gt;# Input in toolbox: FIELDNAME;FIELDNAME; Example: ZIP4;NAME;TYPE;ADDRESS;CITY;ZIP5;STATE;TYPE2;PHONE&lt;/SPAN&gt;
&lt;SPAN style="color: #808080;"&gt;
&lt;/SPAN&gt;intable = arcpy.GetParameterAsText(&lt;SPAN style="color: #6897bb;"&gt;0&lt;/SPAN&gt;)
outtable = arcpy.GetParameterAsText(&lt;SPAN style="color: #6897bb;"&gt;1&lt;/SPAN&gt;)
new_field_order = arcpy.GetParameterAsText(&lt;SPAN style="color: #6897bb;"&gt;2&lt;/SPAN&gt;)

new_fields = new_field_order.split(&lt;SPAN style="color: #a5c261;"&gt;';'&lt;/SPAN&gt;)
final_list = []

&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;for &lt;/SPAN&gt;field &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;in &lt;/SPAN&gt;new_fields:
&amp;nbsp; final_list.append(field)

reorder_fields(intable&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;outtable&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;final_list&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #aa4926;"&gt;add_missing&lt;/SPAN&gt;=&lt;SPAN style="color: #8888c6;"&gt;True&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I attached a toolbox for 10.1 &amp;amp; 10.2.&amp;nbsp; I have successfully run this a dozen times.&amp;nbsp; Make sure to input your text variable as such:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808080;"&gt;ZIP4;NAME;TYPE;ADDRESS;CITY;ZIP5;STATE;TYPE2;PHONE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808080;"&gt;Do not include any quotes in your string.&amp;nbsp; By parsing the fields in as one long direct string, you can split it into a list and properly pass the values into the script using the toolbox.&amp;nbsp; I also included the ability to select your shapefile directly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="212218" class="image-1 jive-image" height="483" src="https://community.esri.com/legacyfs/online/212218_pastedImage_10.png" style="width: 802px; height: 483.787px;" width="802" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if this works for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:24:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/formatting-parameters-for-a-field-reordering-tool/m-p/645548#M50329</guid>
      <dc:creator>AlexanderBrown5</dc:creator>
      <dc:date>2021-12-12T03:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting parameters for a field reordering tool</title>
      <link>https://community.esri.com/t5/python-questions/formatting-parameters-for-a-field-reordering-tool/m-p/645549#M50330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alex,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is perfect! Worked like a charm! I really appreciate you taking the time to help me!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2016 11:41:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/formatting-parameters-for-a-field-reordering-tool/m-p/645549#M50330</guid>
      <dc:creator>DavidHuggins</dc:creator>
      <dc:date>2016-07-19T11:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting parameters for a field reordering tool</title>
      <link>https://community.esri.com/t5/python-questions/formatting-parameters-for-a-field-reordering-tool/m-p/645550#M50331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dave,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Awesome! No problem, glad I could help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~Alex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2016 14:38:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/formatting-parameters-for-a-field-reordering-tool/m-p/645550#M50331</guid>
      <dc:creator>AlexanderBrown5</dc:creator>
      <dc:date>2016-07-19T14:38:31Z</dc:date>
    </item>
  </channel>
</rss>

