<?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: Layer's symbology polygon info stuck in &amp;quot;all other values&amp;quot; with arcpy in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/layer-s-symbology-polygon-info-stuck-in-quot-all/m-p/1283336#M67534</link>
    <description>&lt;P&gt;That is odd, since it worked on a test dataset for but my value and label was both 0,1,2, though so it matched. It being in a fgdb shouldn't matter.&amp;nbsp; I wonder if it's grouping the value.&amp;nbsp; In your picture, the value is numbers, but the label is a string... what if you use the itm.values[0][0] instead?&lt;/P&gt;&lt;LI-CODE lang="python"&gt;grpColors = {'0': {'color': {"RGB": [0, 0, 0, 50]}, 'label': 'Choose'},
             '1': {'color': {"RGB": [0, 112, 255, 50]}, 'label': 'Easement'},
             '2': {'color': {"RGB": [56, 168, 0, 50]}, 'label': 'Fee'},
             '3': {'color': {"RGB": [255, 0, 0, 50]}, 'label': 'License'},
             }

for grp in sym.renderer.groups:
    for itm in grp.items:
        d = grpColors.get(itm.values[0][0], {'color': {"RGB": [255, 255, 255, 50]}, 'label': 'Not Matched'})

        itm.symbol.color = d['color']
        itm.symbol.outlineColor = {"RGB": [255, 255, 255, 100]}
        itm.symbol.outlineWidth = 0.75
        itm.label = d['label']
        print(itm.label)

l.symbology = sym&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Apr 2023 14:05:15 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2023-04-27T14:05:15Z</dc:date>
    <item>
      <title>Layer's symbology polygon info stuck in "all other values" with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/layer-s-symbology-polygon-info-stuck-in-quot-all/m-p/1283053#M67527</link>
      <description>&lt;P&gt;I have some arcpy python code that successfully writes the symbology of a layer but the actual polygons only show up as "&amp;lt;all other values&amp;gt;". Any ideas on how to correct this?&lt;/P&gt;&lt;P&gt;The fields data are domain values, I'm not sure if that effects anything.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nsidaniel_0-1682540843628.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/69213iB650375395D7E5F0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nsidaniel_0-1682540843628.png" alt="nsidaniel_0-1682540843628.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the code:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy, sys, os
print(TWP)

aprx = arcpy.mp.ArcGISProject("Current")
m = aprx.listMaps("Map")[0]
l = m.listLayers(TWP + "_RIGHTS")[0]
sym = l.symbology
    
sym.updateRenderer('UniqueValueRenderer')
sym.renderer.fields = ['RightsType']

for grp in sym.renderer.groups:
    for itm in grp.items:
        label = itm.label

        if itm.label == "Choose":
            itm.symbol.color = {"RGB": [0, 0, 0, 50]}      
            itm.symbol.outlineColor = {"RGB": [255, 255, 255, 100]}
            itm.symbol.outlineWidth = 0.75
            itm.label = str(label)

        elif itm.label == "Easement":
            itm.symbol.color = {"RGB": [0, 112, 255, 50]}      
            itm.symbol.outlineColor = {"RGB": [255, 255, 255, 100]}
            itm.symbol.outlineWidth = 0.75  
            itm.label = str(label)

        elif itm.label == "Fee":
            itm.symbol.color = {"RGB": [56, 168, 0, 50]}
            itm.symbol.outlineColor = {"RGB": [255, 255, 255, 100]}
            itm.symbol.outlineWidth = 0.75
            itm.label = str(label)

        elif itm.label == "License":
            itm.symbol.color = {"RGB": [255, 0, 0, 50]}
            itm.symbol.outlineColor = {"RGB": [255, 255, 255, 100]}
            itm.symbol.outlineWidth = 0.75
            itm.label = str(label)

        print(label)    
    l.symbology = sym

aprx.save() 
print("Completed"+" "+time.strftime("%x" +" "+ "(%a)" +" "+ "at"+" "+"%I:%M"))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 20:46:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/layer-s-symbology-polygon-info-stuck-in-quot-all/m-p/1283053#M67527</guid>
      <dc:creator>nsidaniel</dc:creator>
      <dc:date>2023-04-26T20:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: Layer's symbology polygon info stuck in "all other values" with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/layer-s-symbology-polygon-info-stuck-in-quot-all/m-p/1283160#M67528</link>
      <description>&lt;P&gt;If the itm.label is already a string label, setting it again is somewhat redundant and could be causing the problem with groupings there.&amp;nbsp; What does this give you, with omitting the assignment?&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy, sys, os

print(TWP)

aprx = arcpy.mp.ArcGISProject("Current")
m = aprx.listMaps("Map")[0]
l = m.listLayers(TWP + "_RIGHTS")[0]
sym = l.symbology

sym.updateRenderer('UniqueValueRenderer')
sym.renderer.fields = ['RightsType']

grpColors = { 'Choose' : {"RGB": [0, 0, 0, 50]},
              'Easement' : {"RGB": [0, 112, 255, 50]},
              'Fee' : {"RGB": [56, 168, 0, 50]},
              'License': {"RGB": [255, 0, 0, 50]}
              }

for grp in sym.renderer.groups:
    for itm in grp.items:
        itm.symbol.color = grpColors.get(itm.label, {"RGB": [255, 255, 255, 50]})
        itm.symbol.outlineColor = {"RGB": [255, 255, 255, 100]}
        itm.symbol.outlineWidth = 0.75

        print(itm.label)
    l.symbology = sym

aprx.save()
print("Completed" + " " + time.strftime("%x" + " " + "(%a)" + " " + "at" + " " + "%I:%M"))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 00:44:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/layer-s-symbology-polygon-info-stuck-in-quot-all/m-p/1283160#M67528</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-04-27T00:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: Layer's symbology polygon info stuck in "all other values" with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/layer-s-symbology-polygon-info-stuck-in-quot-all/m-p/1283321#M67533</link>
      <description>&lt;P&gt;@Anonymous UserThat's some really elegant code.&lt;/P&gt;&lt;P&gt;Unfortunately, all of the info remains as "&amp;lt;all other values&amp;gt;"! I'm beginning to suspect that the issue is more basic. Since TWP + "_RIGHTS" is a File Geodatabase Feature Class, it's simply is not possible to apply symbology unless I convert it to a SHP file first which of course loses the domain drop-down fields.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 13:37:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/layer-s-symbology-polygon-info-stuck-in-quot-all/m-p/1283321#M67533</guid>
      <dc:creator>nsidaniel</dc:creator>
      <dc:date>2023-04-27T13:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: Layer's symbology polygon info stuck in "all other values" with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/layer-s-symbology-polygon-info-stuck-in-quot-all/m-p/1283336#M67534</link>
      <description>&lt;P&gt;That is odd, since it worked on a test dataset for but my value and label was both 0,1,2, though so it matched. It being in a fgdb shouldn't matter.&amp;nbsp; I wonder if it's grouping the value.&amp;nbsp; In your picture, the value is numbers, but the label is a string... what if you use the itm.values[0][0] instead?&lt;/P&gt;&lt;LI-CODE lang="python"&gt;grpColors = {'0': {'color': {"RGB": [0, 0, 0, 50]}, 'label': 'Choose'},
             '1': {'color': {"RGB": [0, 112, 255, 50]}, 'label': 'Easement'},
             '2': {'color': {"RGB": [56, 168, 0, 50]}, 'label': 'Fee'},
             '3': {'color': {"RGB": [255, 0, 0, 50]}, 'label': 'License'},
             }

for grp in sym.renderer.groups:
    for itm in grp.items:
        d = grpColors.get(itm.values[0][0], {'color': {"RGB": [255, 255, 255, 50]}, 'label': 'Not Matched'})

        itm.symbol.color = d['color']
        itm.symbol.outlineColor = {"RGB": [255, 255, 255, 100]}
        itm.symbol.outlineWidth = 0.75
        itm.label = d['label']
        print(itm.label)

l.symbology = sym&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 14:05:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/layer-s-symbology-polygon-info-stuck-in-quot-all/m-p/1283336#M67534</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-04-27T14:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: Layer's symbology polygon info stuck in "all other values" with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/layer-s-symbology-polygon-info-stuck-in-quot-all/m-p/1283368#M67535</link>
      <description>&lt;P&gt;It still didn't work @Anonymous User! Did your test layer have domains?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 15:09:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/layer-s-symbology-polygon-info-stuck-in-quot-all/m-p/1283368#M67535</guid>
      <dc:creator>nsidaniel</dc:creator>
      <dc:date>2023-04-27T15:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: Layer's symbology polygon info stuck in "all other values" with arcpy</title>
      <link>https://community.esri.com/t5/python-questions/layer-s-symbology-polygon-info-stuck-in-quot-all/m-p/1283529#M67536</link>
      <description>&lt;P&gt;I found that arcpy.da.UpdateCursor causes the polygons' information to be stuck in &amp;lt;all other values&amp;gt; and thus unable to display the symbology. @Anonymous User identified that this is bug.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 18:47:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/layer-s-symbology-polygon-info-stuck-in-quot-all/m-p/1283529#M67536</guid>
      <dc:creator>nsidaniel</dc:creator>
      <dc:date>2023-04-27T18:47:12Z</dc:date>
    </item>
  </channel>
</rss>

