<?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: How can i change the layer label in TOC with py ? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-can-i-change-the-layer-label-in-toc-with-py/m-p/7716#M641</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please, try to remember it!!! i really need to change this automatically!!!&lt;/P&gt;&lt;P&gt;help me!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Mar 2017 19:57:56 GMT</pubDate>
    <dc:creator>Raphael_Augusto_FoscariniFerre</dc:creator>
    <dc:date>2017-03-15T19:57:56Z</dc:date>
    <item>
      <title>How can i change the layer label in TOC with py ?</title>
      <link>https://community.esri.com/t5/python-questions/how-can-i-change-the-layer-label-in-toc-with-py/m-p/7711#M636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to change this information, with python:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="341070" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/341070_pastedImage_1.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have this code (got here: &lt;A href="https://community.esri.com/thread/43148" target="_blank"&gt;https://community.esri.com/thread/43148&lt;/A&gt;&amp;nbsp;) , but it changes the layer name. I want to change layer label.&lt;/P&gt;&lt;P&gt;It is a simple feature, with no unique values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;import arcpy, os
from arcpy import env&amp;nbsp; 
env.workspace = os.curdir

&amp;nbsp; 
for mxdFile in arcpy.ListFiles("*.mxd"):&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; mxdPath = env.workspace + "\\" + mxdFile&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd = arcpy.mapping.MapDocument(mxdPath)&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; layers = arcpy.mapping.ListLayers(mxd)&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; for lyr in layers:&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if lyr.name == "old name":
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lyr.name = "newname"

&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.RefreshTOC()
&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd.save()‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:19:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-can-i-change-the-layer-label-in-toc-with-py/m-p/7711#M636</guid>
      <dc:creator>Raphael_Augusto_FoscariniFerre</dc:creator>
      <dc:date>2021-12-10T20:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: How can i change the layer label in TOC with py ?</title>
      <link>https://community.esri.com/t5/python-questions/how-can-i-change-the-layer-label-in-toc-with-py/m-p/7712#M637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm fairly certain that a layer label value is not exposed with the arcpy module and therefore cannot be changed with arcpy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Mar 2017 19:43:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-can-i-change-the-layer-label-in-toc-with-py/m-p/7712#M637</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2017-03-15T19:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: How can i change the layer label in TOC with py ?</title>
      <link>https://community.esri.com/t5/python-questions/how-can-i-change-the-layer-label-in-toc-with-py/m-p/7713#M638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wonder if you can use &lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/uniquevaluessymbology-class.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/uniquevaluessymbology-class.htm"&gt;UniqueValuesSymbology—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp; but "trick" the unique value to only have one.&amp;nbsp; then use one of these properties?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/341047_pastedImage_6.png" style="width: 620px; height: 320px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I didn't see a set of properties for no-unique-values otherwise.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Mar 2017 19:45:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-can-i-change-the-layer-label-in-toc-with-py/m-p/7713#M638</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2017-03-15T19:45:06Z</dc:date>
    </item>
    <item>
      <title>Re: How can i change the layer label in TOC with py ?</title>
      <link>https://community.esri.com/t5/python-questions/how-can-i-change-the-layer-label-in-toc-with-py/m-p/7714#M639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem is, i need to change it in several mxds. More than 1000... And it would make changes in the legend in layout also, because would add 'headings', for example...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thats why i want to try this way!! but thanks for the help...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Mar 2017 19:49:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-can-i-change-the-layer-label-in-toc-with-py/m-p/7714#M639</guid>
      <dc:creator>Raphael_Augusto_FoscariniFerre</dc:creator>
      <dc:date>2017-03-15T19:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: How can i change the layer label in TOC with py ?</title>
      <link>https://community.esri.com/t5/python-questions/how-can-i-change-the-layer-label-in-toc-with-py/m-p/7715#M640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sheesh I'm slipping....&amp;nbsp;I remember looking at that about a month ago and reminding myself to use that if needed sometime.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Mar 2017 19:54:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-can-i-change-the-layer-label-in-toc-with-py/m-p/7715#M640</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2017-03-15T19:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: How can i change the layer label in TOC with py ?</title>
      <link>https://community.esri.com/t5/python-questions/how-can-i-change-the-layer-label-in-toc-with-py/m-p/7716#M641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please, try to remember it!!! i really need to change this automatically!!!&lt;/P&gt;&lt;P&gt;help me!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Mar 2017 19:57:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-can-i-change-the-layer-label-in-toc-with-py/m-p/7716#M641</guid>
      <dc:creator>Raphael_Augusto_FoscariniFerre</dc:creator>
      <dc:date>2017-03-15T19:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: How can i change the layer label in TOC with py ?</title>
      <link>https://community.esri.com/t5/python-questions/how-can-i-change-the-layer-label-in-toc-with-py/m-p/7717#M642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I doubt it would change your legend unless your legend item for that layer was already using a style item that used the layer heading.&amp;nbsp; You could always change your legend item style&amp;nbsp;to use only the layer name, or layer name and label only if you didn't want an heading added to them.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Mar 2017 19:59:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-can-i-change-the-layer-label-in-toc-with-py/m-p/7717#M642</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2017-03-15T19:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: How can i change the layer label in TOC with py ?</title>
      <link>https://community.esri.com/t5/python-questions/how-can-i-change-the-layer-label-in-toc-with-py/m-p/7718#M643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;I figured how to do it. I just need to change it, the way i want one time, than save a .lyr from the correct information (it can also change symbology, and other stuff).&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;The script below, will apply the .lyr file to your layer in the TOC. You just must specify the name of the layer, like displayed in TOC.&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;It will do to all MXD files, in the same folder of the script.&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&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="punctuation token"&gt;,&lt;/SPAN&gt; os
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcpy &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; env&amp;nbsp; 
env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;curdir

&amp;nbsp; 
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; mxdFile &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListFiles&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"*.mxd"&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;&amp;nbsp; mxdPath &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &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; mxdFile&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; 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;mxdPath&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; layers &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;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; lyr &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; layers&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; lyr&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;"layer_name_in_TOC"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;#change here&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; mxdPath
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; symbologyLayer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"D:\LayerFile.lyr"&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;#change here&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ApplySymbologyFromLayer_management &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;lyr&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; symbologyLayer&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; 

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;RefreshTOC&lt;SPAN class="punctuation token"&gt;(&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 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;&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:19:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-can-i-change-the-layer-label-in-toc-with-py/m-p/7718#M643</guid>
      <dc:creator>Raphael_Augusto_FoscariniFerre</dc:creator>
      <dc:date>2021-12-10T20:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: How can i change the layer label in TOC with py ?</title>
      <link>https://community.esri.com/t5/python-questions/how-can-i-change-the-layer-label-in-toc-with-py/m-p/7719#M644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From your screenshot, it appears you are using ArcMap.&amp;nbsp; If you are using ArcGIS Pro, there is a &lt;A href="http://pro.arcgis.com/en/pro-app/arcpy/mapping/simplerenderer-class.htm"&gt;SimpleRenderer &lt;/A&gt;class you can use to simply and straightforwardly change a symbol layer for simple symbology.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2017 16:05:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-can-i-change-the-layer-label-in-toc-with-py/m-p/7719#M644</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-03-16T16:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: How can i change the layer label in TOC with py ?</title>
      <link>https://community.esri.com/t5/python-questions/how-can-i-change-the-layer-label-in-toc-with-py/m-p/7720#M645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ian, Here a year later. Can I edit labels&amp;nbsp;so that I allocate a field in a layer manually or through arcpy? It is&amp;nbsp;denoted as read/write but cant edit it other than through TOC.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jul 2018 08:33:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-can-i-change-the-layer-label-in-toc-with-py/m-p/7720#M645</guid>
      <dc:creator>WilliamKalande</dc:creator>
      <dc:date>2018-07-03T08:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: How can i change the layer label in TOC with py ?</title>
      <link>https://community.esri.com/t5/python-questions/how-can-i-change-the-layer-label-in-toc-with-py/m-p/7721#M646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What version of ArcMap are you using?&amp;nbsp; What is your current code and result?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have ArcMap 10.6, and I can change the label class to point to a different field and it works fine:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&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;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; lyr &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="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="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; lbl &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; lyr&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;labelClasses&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="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; lbl&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;expression &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'[NEW_FIELD]'&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;RefreshActiveView&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:19:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-can-i-change-the-layer-label-in-toc-with-py/m-p/7721#M646</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-12-10T20:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: How can i change the layer label in TOC with py ?</title>
      <link>https://community.esri.com/t5/python-questions/how-can-i-change-the-layer-label-in-toc-with-py/m-p/7722#M647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Joshua&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I applied the code, it changes the expression label field as below and that is fine&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I need though is the TOC to&amp;nbsp;maintain the value field&amp;nbsp;assigned under symbology properties but allow me to use another field in the layer as a label or to copy the corresponding values into TOC. What I mean I want for instance the values below in the OpCodeBoundaries. The value field set in symbology is say field A. I want to maintain that but change the display in the TOC window to display values in Field B. Effectively, that will change the display in the legend&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2018 02:07:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-can-i-change-the-layer-label-in-toc-with-py/m-p/7722#M647</guid>
      <dc:creator>WilliamKalande</dc:creator>
      <dc:date>2018-07-04T02:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: How can i change the layer label in TOC with py ?</title>
      <link>https://community.esri.com/t5/python-questions/how-can-i-change-the-layer-label-in-toc-with-py/m-p/7723#M648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Honestly, I am not certain what you are after.&amp;nbsp; It seems like you are mixing symbology and labeling.&amp;nbsp; Labels are displayed on the map, not in the TOC or a map legend.&amp;nbsp; You can symbolize and label based on the same field/values; but if I understand what you are trying to do, it isn't possible, at least through ArcPy.&amp;nbsp; That said, I might not understand what you are trying to accomplish.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2018 14:29:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-can-i-change-the-layer-label-in-toc-with-py/m-p/7723#M648</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2018-07-04T14:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: How can i change the layer label in TOC with py ?</title>
      <link>https://community.esri.com/t5/python-questions/how-can-i-change-the-layer-label-in-toc-with-py/m-p/7724#M649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You got me right Joshua. I want to allocate a field to a layer's label in symbology. That effectively changes the layer labels displayed in TOC. Not sure if it is possible. If it is it will save me a&amp;nbsp; lot of time.&lt;/P&gt;&lt;P&gt;Alternatively, I can resolve the issue by finding a way to write into the TOC&amp;nbsp;or copy field attributes into the TOC. Currently, I am copying and pasting a single field attribute at a time&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="413223" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/413223_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jul 2018 01:03:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-can-i-change-the-layer-label-in-toc-with-py/m-p/7724#M649</guid>
      <dc:creator>WilliamKalande</dc:creator>
      <dc:date>2018-07-05T01:03:40Z</dc:date>
    </item>
    <item>
      <title>Re: How can i change the layer label in TOC with py ?</title>
      <link>https://community.esri.com/t5/python-questions/how-can-i-change-the-layer-label-in-toc-with-py/m-p/7725#M650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For ArcMap and ArcPy, definitely not possible.&amp;nbsp; Beyond ArcMap, I still need to think about it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jul 2018 15:55:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-can-i-change-the-layer-label-in-toc-with-py/m-p/7725#M650</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2018-07-05T15:55:08Z</dc:date>
    </item>
  </channel>
</rss>

