<?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: hide fields and export table through python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/hide-fields-and-export-table-through-python/m-p/108970#M8412</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;field.name&lt;/SPAN&gt; and not &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;field.Name&lt;/SPAN&gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a frustration of mine with Esri and ArcPy.&amp;nbsp; Python is case sensitive,&amp;nbsp; "name" is not the same as "Name" when naming variables, functions, methods, etc....&amp;nbsp; That said, there are some, but not all, ArcPy classes that allow for case insensitive calling of methods.&amp;nbsp; By not enforcing case sensitivity, ArcPy can teach new Python learners bad habits.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Sep 2017 14:02:47 GMT</pubDate>
    <dc:creator>JoshuaBixby</dc:creator>
    <dc:date>2017-09-27T14:02:47Z</dc:date>
    <item>
      <title>hide fields and export table through python</title>
      <link>https://community.esri.com/t5/python-questions/hide-fields-and-export-table-through-python/m-p/108969#M8411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am building a script to run as an ArcGIS tool that takes a line file and does a bunch of stuff to it, then exports a table and uses that table to make route events.&lt;/P&gt;&lt;P&gt;I do not need, nor do I want, all of the fields from the original line file in the layer events attributes table. As such, I have been working on a way to export only the necessary fields from the feature class to a table for use in the make route even layers tool.&lt;/P&gt;&lt;P&gt;Here is what I have so far:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;#Hide all fields that are not required for samples.&lt;/SPAN&gt;
keepFieldList &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"SAMPLE_ID"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"SEGMENT_ID"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"NAME"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"LENGTH"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"WIDTH"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"BEGIN_MP"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"END_MP"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
fieldInfo &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FieldInfo&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
fieldList &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListFields&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;sampevents&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; field &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; fieldList&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; field&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; keepFieldList&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldInfo &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; fieldInfo &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; field&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Name &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; field&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"VISIBLE;"&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldInfo &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; fieldInfo &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; field&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Name &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; field&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"HIDDEN;"&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;SPAN class="comment token"&gt;#Export sample events to table for use in make route event layer.&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;TableToTable_conversion&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;sampevents&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; gisdata&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Sample_Events_Table"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the traceback info (Note that line 157 in the full script is line 9 in the above portion):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt; File "C:\Projects\CreateSamples\CreateSamples.py", line 157, in &amp;lt;module&amp;gt;&lt;BR /&gt; fieldInfo = fieldInfo + field.Name + " " + field.name + "HIDDEN;"&lt;BR /&gt;AttributeError: 'Field' object has no attribute 'Name'&lt;/P&gt;&lt;P&gt;Failed to execute (CreateSamples).&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help resolving this. I am not entirely sure what the error is saying. My idea here is to hide all fields not in the keepFieldList and then export those fields to a new table. Then that table will be used as the event table input in the make route events tool.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:33:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/hide-fields-and-export-table-through-python/m-p/108969#M8411</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T06:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: hide fields and export table through python</title>
      <link>https://community.esri.com/t5/python-questions/hide-fields-and-export-table-through-python/m-p/108970#M8412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;field.name&lt;/SPAN&gt; and not &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;field.Name&lt;/SPAN&gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a frustration of mine with Esri and ArcPy.&amp;nbsp; Python is case sensitive,&amp;nbsp; "name" is not the same as "Name" when naming variables, functions, methods, etc....&amp;nbsp; That said, there are some, but not all, ArcPy classes that allow for case insensitive calling of methods.&amp;nbsp; By not enforcing case sensitivity, ArcPy can teach new Python learners bad habits.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Sep 2017 14:02:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/hide-fields-and-export-table-through-python/m-p/108970#M8412</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-09-27T14:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: hide fields and export table through python</title>
      <link>https://community.esri.com/t5/python-questions/hide-fields-and-export-table-through-python/m-p/108971#M8413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks! Yeah, I sort of knew that, but I am still fumbling through some of this stuff. Fixing the case to all lower got rid of this particular issue, but I ended up with a different error talking about operand types.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt; File "C:\Projects\CreateSamples\CreateSamples.py", line 157, in &amp;lt;module&amp;gt;&lt;BR /&gt; fieldInfo = fieldInfo + field.name + " " + field.name + "HIDDEN"&lt;BR /&gt;TypeError: unsupported operand type(s) for +: 'FieldInfo' and 'unicode'&lt;/P&gt;&lt;P&gt;Failed to execute (CreateSamples).&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Seems that everything should be correct for the field info function, but maybe I am missing something in the syntax to update those...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Sep 2017 14:18:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/hide-fields-and-export-table-through-python/m-p/108971#M8413</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2017-09-27T14:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: hide fields and export table through python</title>
      <link>https://community.esri.com/t5/python-questions/hide-fields-and-export-table-through-python/m-p/108972#M8414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Instead of trying to hide the fields for copy, can you use the field mapping in the table to table tool. That is how I do it. First do it manually once, you can see the syntax, and look at the help&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/10.3/tools/conversion-toolbox/table-to-table.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/tools/conversion-toolbox/table-to-table.htm"&gt;Table To Table—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Field Mapping (Optional)&lt;/P&gt;&lt;P&gt;The fields and field contents chosen from the input table. You can add, rename, or delete output fields as well as set properties such as data type and merge rule.&lt;/P&gt;&lt;P&gt;&lt;A class="" href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/executing-tools/using-the-field-mapping-control.htm"&gt;Learn more about choosing and setting the output fields&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;You can use the ArcPy &lt;SPAN class=""&gt;&lt;A class="" href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-classes/fieldmappings.htm"&gt;FieldMappings&lt;/A&gt;&lt;/SPAN&gt; object for this parameter.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Sep 2017 14:35:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/hide-fields-and-export-table-through-python/m-p/108972#M8414</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2017-09-27T14:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: hide fields and export table through python</title>
      <link>https://community.esri.com/t5/python-questions/hide-fields-and-export-table-through-python/m-p/108973#M8415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-classes/fieldinfo.htm" title="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-classes/fieldinfo.htm"&gt;FieldInfo—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp; is an object with all sorts of methods.&amp;nbsp; The error message is saying that you can't concatenate a unicode object to a fieldInfo object.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Sep 2017 14:43:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/hide-fields-and-export-table-through-python/m-p/108973#M8415</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-09-27T14:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: hide fields and export table through python</title>
      <link>https://community.esri.com/t5/python-questions/hide-fields-and-export-table-through-python/m-p/108974#M8416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've sort of looked into this, but it seems fairly overwhelming. I think this might be the ideal solution because it reduces code and sort of cleans things up, and takes care of this piece in a single step...I just don't really know what I am doing yet haha. I will try to dive in a little deeper on the field mapping stuff. Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Sep 2017 14:44:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/hide-fields-and-export-table-through-python/m-p/108974#M8416</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2017-09-27T14:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: hide fields and export table through python</title>
      <link>https://community.esri.com/t5/python-questions/hide-fields-and-export-table-through-python/m-p/108975#M8417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rebecca, I was able to work out how to use this, and it worked perfectly, and lets me avoid using additional template files for another idea I had. Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Sep 2017 15:29:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/hide-fields-and-export-table-through-python/m-p/108975#M8417</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2017-09-27T15:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: hide fields and export table through python</title>
      <link>https://community.esri.com/t5/python-questions/hide-fields-and-export-table-through-python/m-p/108976#M8418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad it worked for you.&amp;nbsp; Never overlook what is already built into the tools, and as mentioned, test it manually, then right click on the results and choose to copy the python snippet so you can see what the format is they need. Keep in mind though, that sometimes they have a lot more in the snippet than you need.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I typically drop any arguments at the end of the snippet that are default.&amp;nbsp; Then any in the middle that are default can sometimes just have a "#".&amp;nbsp; Also, usually you you don't need the "variablename = " portion, but I set the variables up before I use the tool and then just include those in the line.&amp;nbsp; Just some of the things I do, but everyone has their own workflow.&amp;nbsp;&amp;nbsp; (and always remember that the print and arcpy.AddMessage are your friend.)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Sep 2017 17:18:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/hide-fields-and-export-table-through-python/m-p/108976#M8418</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2017-09-27T17:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: hide fields and export table through python</title>
      <link>https://community.esri.com/t5/python-questions/hide-fields-and-export-table-through-python/m-p/108977#M8419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot for the advice Rebecca! Much appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Sep 2017 17:36:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/hide-fields-and-export-table-through-python/m-p/108977#M8419</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2017-09-27T17:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: hide fields and export table through python</title>
      <link>https://community.esri.com/t5/python-questions/hide-fields-and-export-table-through-python/m-p/108978#M8420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since Raifq didnt't mention how to solve the &lt;SPAN style="background-color: #ffffff;"&gt;concatenation error (TypeError: unsupported operand type(s) for +: 'FieldInfo' and 'unicode')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I am adding the full correct answer just for&amp;nbsp;future&amp;nbsp; documentation:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;keepFieldList &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'OBJECTID'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'f1'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'f2'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'f3'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
Trees&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'D:/Test/1/x.gdb/Trees'&lt;/SPAN&gt;

fieldList &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListFields&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Trees&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; field &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; fieldList&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; field&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; keepFieldList&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldInfo &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; fieldInfo &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; field&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; field&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" VISIBLE;"&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldInfo &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; str&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fieldInfo&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; str&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;field&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; str&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;field&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" HIDDEN;"&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- change the field names to str&lt;/P&gt;&lt;P&gt;- add space before visible and hidden.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:33:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/hide-fields-and-export-table-through-python/m-p/108978#M8420</guid>
      <dc:creator>AhmadSALEH1</dc:creator>
      <dc:date>2021-12-11T06:33:46Z</dc:date>
    </item>
  </channel>
</rss>

