<?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: Graduated Colors Renderer Errors in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/graduated-colors-renderer-errors/m-p/1091263#M62148</link>
    <description>&lt;P&gt;Looking into this further, i realized this classification field I'm trying to identify is a from a joined table. If I use a field not from the joined table it works fine.&lt;/P&gt;&lt;P&gt;The 'USER_PATIENT_ZIP' field is not from a joined table, and it validates. But, the field I want is from a joined table, and it's invalid somehow.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;if hasattr(sym, 'renderer'):
    if sym.renderer.type == 'GraduatedColorsRenderer':
        sym.renderer.classificationField = 'USER_PATIENT_ZIP'
        print('Zip OK')
        sym.renderer.classificationField = 'Blckgrp2020_iCareCountOfVaccinated_ALL_FirstDose_Black_PercentVa'
        print('Dose OK')

### Zip OK

### ---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
In  [193]:
Line 5:     sym.renderer.classificationField = 'Blckgrp2020_iCareCountOfVaccinated_ALL_FirstDose_Black_PercentVa'

File C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\arcobjects\_base.py, in _set:
Line 109:   return setattr(self._arc_object, attr_name, cval(val))

RuntimeError: Invalid classificationField : Blckgrp2020_iCareCountOfVaccinated_ALL_FirstDose_Black_PercentVa
---------------------------------------------------------------------------&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 23 Aug 2021 15:14:30 GMT</pubDate>
    <dc:creator>JaredPilbeam2</dc:creator>
    <dc:date>2021-08-23T15:14:30Z</dc:date>
    <item>
      <title>Graduated Colors Renderer Errors</title>
      <link>https://community.esri.com/t5/python-questions/graduated-colors-renderer-errors/m-p/1090971#M62135</link>
      <description>&lt;P&gt;I have this small code to change a feature layer's symbology. I'm referencing &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/graduatedcolorsrenderer-class.htm" target="_self"&gt;this&lt;/A&gt; help doc.&lt;/P&gt;&lt;P&gt;When I try to change the break count I get a RuntimeError. And when I try to identify the classification field I don't seem to find it. Using a print statement, I identify other properties but not the field. The only thing i can think of is possibly because this field is set to a custom expression:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sym.png" style="width: 500px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/21295i7EC444440D834268/image-size/large?v=v2&amp;amp;px=999" role="button" title="sym.png" alt="sym.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sym2.png" style="width: 450px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/21296i7269D0FE94C6BDF5/image-size/large?v=v2&amp;amp;px=999" role="button" title="sym2.png" alt="sym2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;for lyr in m.listLayers():
    if lyr.isFeatureLayer:
        sym = lyr.symbology
        
        if hasattr(sym, 'renderer'):
            #type of renderer 
            if sym.renderer.type == 'GraduatedColorsRenderer':
                #sym.renderer.breakCount = 4 -RuntimeError: Invalid breakCount 4
                print('break count: {}\nmethod: {}\nfield: {}'.format(sym.renderer.breakCount, 
                                                                        sym.renderer.classificationMethod, 
                                                                        sym.renderer.classificationField))

 &lt;/LI-CODE&gt;&lt;LI-CODE lang="markdown"&gt;prints:
break count: 5
method: ManualInterval
field:&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 20 Aug 2021 21:22:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/graduated-colors-renderer-errors/m-p/1090971#M62135</guid>
      <dc:creator>JaredPilbeam2</dc:creator>
      <dc:date>2021-08-20T21:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: Graduated Colors Renderer Errors</title>
      <link>https://community.esri.com/t5/python-questions/graduated-colors-renderer-errors/m-p/1091263#M62148</link>
      <description>&lt;P&gt;Looking into this further, i realized this classification field I'm trying to identify is a from a joined table. If I use a field not from the joined table it works fine.&lt;/P&gt;&lt;P&gt;The 'USER_PATIENT_ZIP' field is not from a joined table, and it validates. But, the field I want is from a joined table, and it's invalid somehow.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;if hasattr(sym, 'renderer'):
    if sym.renderer.type == 'GraduatedColorsRenderer':
        sym.renderer.classificationField = 'USER_PATIENT_ZIP'
        print('Zip OK')
        sym.renderer.classificationField = 'Blckgrp2020_iCareCountOfVaccinated_ALL_FirstDose_Black_PercentVa'
        print('Dose OK')

### Zip OK

### ---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
In  [193]:
Line 5:     sym.renderer.classificationField = 'Blckgrp2020_iCareCountOfVaccinated_ALL_FirstDose_Black_PercentVa'

File C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\arcobjects\_base.py, in _set:
Line 109:   return setattr(self._arc_object, attr_name, cval(val))

RuntimeError: Invalid classificationField : Blckgrp2020_iCareCountOfVaccinated_ALL_FirstDose_Black_PercentVa
---------------------------------------------------------------------------&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 15:14:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/graduated-colors-renderer-errors/m-p/1091263#M62148</guid>
      <dc:creator>JaredPilbeam2</dc:creator>
      <dc:date>2021-08-23T15:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: Graduated Colors Renderer Errors</title>
      <link>https://community.esri.com/t5/python-questions/graduated-colors-renderer-errors/m-p/1092465#M62179</link>
      <description>&lt;P&gt;The classification field has to be a number in order for the renderer to recognize it. It validated both with float and double. It will not work with text fields. I'm in contact with an ESRI analyst who is looking into why that is.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 20:23:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/graduated-colors-renderer-errors/m-p/1092465#M62179</guid>
      <dc:creator>JaredPilbeam2</dc:creator>
      <dc:date>2021-08-25T20:23:54Z</dc:date>
    </item>
  </channel>
</rss>

