<?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: Toggling Fields within a Feature Class On and Off in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/toggling-fields-within-a-feature-class-on-and-off/m-p/385985#M30437</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use arcpy.Delete_management to remove the feature layer.&amp;nbsp; If you are making feature layers in a standalone or out of process script , they are created in program memory, you can't really save them in different places.&amp;nbsp; Unless the script adds the feature layer to a map document, there is no clean way to just list all the feature layers that have been created.&amp;nbsp; I think the expectation is that a user should track or know what feature layers they have made in their own script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Jul 2017 20:57:51 GMT</pubDate>
    <dc:creator>JoshuaBixby</dc:creator>
    <dc:date>2017-07-12T20:57:51Z</dc:date>
    <item>
      <title>Toggling Fields within a Feature Class On and Off</title>
      <link>https://community.esri.com/t5/python-questions/toggling-fields-within-a-feature-class-on-and-off/m-p/385979#M30431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I've been doing some research into this but have gotten conflicting outputs on whether or not it is possible to turn fields on and off using python in custom tools. I am working on a custom tool that generates KMZs on a state by state level for different departments within the company, but we do not let them see all the attributes within each feature class, thus turning some fields off before we use Map to KML tool. Since I am currently trying to automate this process, I want the custom tool to first turn the fields I do not want shown in the report off before the tool gets to the actual execution in regards to generating the KMZs. One such discussion I looked at was this on titled &lt;A _jive_internal="true" href="https://community.esri.com/thread/85312" target="_blank"&gt;Turn fields off by script&lt;/A&gt;. While Wayne's solution seemed to work for the OP, there were parts of that solution I did not understand. Is there an easier way to approach this or if someone can help break down Wayne's solution, that would be appreciated. I look forward to seeing the ideas everyone has for this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For reference, here's what the solution to the other discussion:&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="keyword token"&gt;import&lt;/SPAN&gt; arcpy
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcpy &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; env
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;overwriteOutput &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;addOutputsToMap &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;
mxd &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MapDocument&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'CURRENT'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
df &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListDataFrames&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mxd&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'*'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
LayerNeedsFieldsTurnedOff &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListLayers&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mxd&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'your target layer name'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; df&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# fill in your desired fields to remain visible &lt;/SPAN&gt;
desiredFields &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'fieldname0'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'fieldname1'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'fieldname2'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'etc'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
field_info &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Describe&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;LayerNeedsFieldsTurnedOff&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;fieldInfo 
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; range&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;field_info&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;count&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&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_info&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getfieldname&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;i&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; desiredFields&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; field_info&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;setvisible&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;i&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'HIDDEN'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MakeFeatureLayer_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;LayerNeedsFieldsTurnedOff&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'temp_layer'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;''&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;''&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; field_info&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
refLyr &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Layer&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'temp_layer'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# rename the ref layer the same as your target layer&lt;/SPAN&gt;
refLyr&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;'your target layer name'&lt;/SPAN&gt;&amp;nbsp; 
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ApplySymbologyFromLayer_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;refLyr&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; LayerNeedsFieldsTurnedOff&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;UpdateLayer&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;df&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; LayerNeedsFieldsTurnedOff&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; refLyr&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
mxd&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;save&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&amp;nbsp; 
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'cleaning up-'&lt;/SPAN&gt; 
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Exists&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'temp_layer'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'\'temp_layer\' still in memory...deleting now...'&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Delete_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'temp_layer'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'deleting obj refs...'&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; mxd&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;LayerNeedsFieldsTurnedOff&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; refLyr &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'done.'&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;/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;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:44:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/toggling-fields-within-a-feature-class-on-and-off/m-p/385979#M30431</guid>
      <dc:creator>VishalShah2</dc:creator>
      <dc:date>2021-12-11T17:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: Toggling Fields within a Feature Class On and Off</title>
      <link>https://community.esri.com/t5/python-questions/toggling-fields-within-a-feature-class-on-and-off/m-p/385980#M30432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The &lt;A href="https://community.esri.com/thread/92204"&gt;Setting Field Visibility&lt;/A&gt;&amp;nbsp; discussion offers a very similar code sample, but the accepted answer provides a bit more explanation.&amp;nbsp; Setting field visibility is a bit convoluted, I don't know why Esri made it so difficult, but there really isn't a simpler approach than the one being suggested in the discussions you and I reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume this is for ArcGIS Desktop/ArcMap.&amp;nbsp; I haven't tried modifying field visibility in ArcGIS Pro.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jul 2017 14:35:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/toggling-fields-within-a-feature-class-on-and-off/m-p/385980#M30432</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-07-12T14:35:54Z</dc:date>
    </item>
    <item>
      <title>Re: Toggling Fields within a Feature Class On and Off</title>
      <link>https://community.esri.com/t5/python-questions/toggling-fields-within-a-feature-class-on-and-off/m-p/385981#M30433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Joshua. This is for ArcGIS DesktopArcMap. It definitely was much more easier to read then the discussion I had posted! Also was easily able t follow it it. I'll have to try that with my script. Thanks again! Do you know if you have to pass another line to pull in the new feature class or it automatically does it when you run the arcpy.MakeFeatureLayer_management line?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jul 2017 14:44:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/toggling-fields-within-a-feature-class-on-and-off/m-p/385981#M30433</guid>
      <dc:creator>VishalShah2</dc:creator>
      <dc:date>2017-07-12T14:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: Toggling Fields within a Feature Class On and Off</title>
      <link>https://community.esri.com/t5/python-questions/toggling-fields-within-a-feature-class-on-and-off/m-p/385982#M30434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would experiment.&amp;nbsp; From the interactive command prompt it definitely creates the layer and adds it to the TOC, but I can't remember how it is handled in script tools.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jul 2017 15:58:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/toggling-fields-within-a-feature-class-on-and-off/m-p/385982#M30434</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-07-12T15:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: Toggling Fields within a Feature Class On and Off</title>
      <link>https://community.esri.com/t5/python-questions/toggling-fields-within-a-feature-class-on-and-off/m-p/385983#M30435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So far I've tried it in the interactive command prompt and it definitely added the new layer to the TOC. I'll have to test it out in the script tool and post my results here. From my understanding, is this a temporary layer? So tat if I closed my mxd, that would disappear? Or would I have to add a line at the end to delete the new layer that was created after my tool is done running?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jul 2017 16:06:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/toggling-fields-within-a-feature-class-on-and-off/m-p/385983#M30435</guid>
      <dc:creator>VishalShah2</dc:creator>
      <dc:date>2017-07-12T16:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Toggling Fields within a Feature Class On and Off</title>
      <link>https://community.esri.com/t5/python-questions/toggling-fields-within-a-feature-class-on-and-off/m-p/385984#M30436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joshua, when you use:&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MakeFeatureLayer_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'input feature'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'output feature'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;field_info&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do, you know where the new feature is automatically created? Trying to run tests but get an error since it already exists in it's location. Need to be able to change where it is saved and all. Also need to delete the original.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jul 2017 20:29:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/toggling-fields-within-a-feature-class-on-and-off/m-p/385984#M30436</guid>
      <dc:creator>VishalShah2</dc:creator>
      <dc:date>2017-07-12T20:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: Toggling Fields within a Feature Class On and Off</title>
      <link>https://community.esri.com/t5/python-questions/toggling-fields-within-a-feature-class-on-and-off/m-p/385985#M30437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use arcpy.Delete_management to remove the feature layer.&amp;nbsp; If you are making feature layers in a standalone or out of process script , they are created in program memory, you can't really save them in different places.&amp;nbsp; Unless the script adds the feature layer to a map document, there is no clean way to just list all the feature layers that have been created.&amp;nbsp; I think the expectation is that a user should track or know what feature layers they have made in their own script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jul 2017 20:57:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/toggling-fields-within-a-feature-class-on-and-off/m-p/385985#M30437</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-07-12T20:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: Toggling Fields within a Feature Class On and Off</title>
      <link>https://community.esri.com/t5/python-questions/toggling-fields-within-a-feature-class-on-and-off/m-p/385986#M30438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How do you remove them from program memory? I did use arcpy.Delete_management to remove the feature layer (which did it make it disappear from TOC and data frame, but now when I try to test my script as a custom tool, I get an error saying that feature layer already exists. The goal is to run this tool at least 4 times a year. I was hoping that the naming of the new feature layer didn't have to change. I currently have at the end of the tool arcpy.Delete_management to delete the newly created feature layer every time to ensure that it can be used again when generating a report.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jul 2017 21:04:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/toggling-fields-within-a-feature-class-on-and-off/m-p/385986#M30438</guid>
      <dc:creator>VishalShah2</dc:creator>
      <dc:date>2017-07-12T21:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: Toggling Fields within a Feature Class On and Off</title>
      <link>https://community.esri.com/t5/python-questions/toggling-fields-within-a-feature-class-on-and-off/m-p/385987#M30439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Joshua,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I figured out how to delete the program memory with the following line:&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Delete_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'in_memory'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;""&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have that line at the beginning of my script to clear the memory and then at the end to clean it up before exiting the custom tool. This way no errors may occur with the temp data being used. Thanks for your help Joshua!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jul 2017 12:23:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/toggling-fields-within-a-feature-class-on-and-off/m-p/385987#M30439</guid>
      <dc:creator>VishalShah2</dc:creator>
      <dc:date>2017-07-13T12:23:18Z</dc:date>
    </item>
  </channel>
</rss>

