<?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: UniqueValueRenderer  method removeValues and addValues does not work correctly if the heading is a blank string in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/uniquevaluerenderer-method-removevalues-and/m-p/1219381#M65750</link>
    <description>&lt;P&gt;Thanks for the reply Roger, I just tested it out and it does work with only a space and it does truncate itself, thanks for the suggestion! I had just changed the heading manually and continued with the project, but this makes the legend in the ultimate web map much cleaner because it just puts the icon in line with the field value.&lt;/P&gt;</description>
    <pubDate>Thu, 06 Oct 2022 15:21:10 GMT</pubDate>
    <dc:creator>ccowin_odfw</dc:creator>
    <dc:date>2022-10-06T15:21:10Z</dc:date>
    <item>
      <title>UniqueValueRenderer  method removeValues and addValues does not work correctly if the heading is a blank string</title>
      <link>https://community.esri.com/t5/python-questions/uniquevaluerenderer-method-removevalues-and/m-p/1218299#M65725</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;Not sure if I'm doing this wrong but to me this seems like this should work just fine but I get the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;SystemError: &amp;lt;built-in method addValues of MappingSymbologyObject object at 0x00000151F8882670&amp;gt; returned NULL without setting an error&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code is as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;p = arcpy.mp.ArcGISProject(path-to-aprx)
mapList = p.listMaps()

for m in mapList:
    layerList = m.listLayers()

    for layer in layerList:
        sym = layer.symbology

        if hasattr(sym, 'renderer'):
            if sym.renderer.type == 'UniqueValueRenderer':
                groupName = sym.renderer.groups[0].heading

                sym.renderer.removeValues({groupName: ['Spring2022']})
                layer.symbology = sym

                sym.renderer.addValues({groupName: ['Fall2022']})
                layer.symbology = sym&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I go manually into the aprx and change the headings to not a blank string it works fine.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 16:11:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/uniquevaluerenderer-method-removevalues-and/m-p/1218299#M65725</guid>
      <dc:creator>ccowin_odfw</dc:creator>
      <dc:date>2022-10-03T16:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: UniqueValueRenderer  method removeValues and addValues does not work correctly if the heading is a blank string</title>
      <link>https://community.esri.com/t5/python-questions/uniquevaluerenderer-method-removevalues-and/m-p/1219369#M65747</link>
      <description>&lt;P&gt;I have two suggestions, and I don't which, if either, will work.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Try setting the heading to a space character instead of the empty string.&amp;nbsp; Perhaps it will be truncated.&lt;/LI&gt;&lt;LI&gt;Try setting the heading to some value, perform your operations, and then set it to the empty string (or space, as above)&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Let us know and good luck!&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 15:07:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/uniquevaluerenderer-method-removevalues-and/m-p/1219369#M65747</guid>
      <dc:creator>RogerDunnGIS</dc:creator>
      <dc:date>2022-10-06T15:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: UniqueValueRenderer  method removeValues and addValues does not work correctly if the heading is a blank string</title>
      <link>https://community.esri.com/t5/python-questions/uniquevaluerenderer-method-removevalues-and/m-p/1219381#M65750</link>
      <description>&lt;P&gt;Thanks for the reply Roger, I just tested it out and it does work with only a space and it does truncate itself, thanks for the suggestion! I had just changed the heading manually and continued with the project, but this makes the legend in the ultimate web map much cleaner because it just puts the icon in line with the field value.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 15:21:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/uniquevaluerenderer-method-removevalues-and/m-p/1219381#M65750</guid>
      <dc:creator>ccowin_odfw</dc:creator>
      <dc:date>2022-10-06T15:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: UniqueValueRenderer  method removeValues and addValues does not work correctly if the heading is a blank string</title>
      <link>https://community.esri.com/t5/python-questions/uniquevaluerenderer-method-removevalues-and/m-p/1219427#M65759</link>
      <description>&lt;P&gt;Great!&amp;nbsp; Please mark my response as a solution as a kind gesture for my time.&amp;nbsp; And good luck with all your GIS efforts to make a great web map!!&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 16:13:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/uniquevaluerenderer-method-removevalues-and/m-p/1219427#M65759</guid>
      <dc:creator>RogerDunnGIS</dc:creator>
      <dc:date>2022-10-06T16:13:00Z</dc:date>
    </item>
  </channel>
</rss>

