I have all my JSON updating figured out and now I am trying to write it to ArcGIS Online to swap out it's JSON file that controls the properties of the webmap.
Found this script below from an Esri staff member that should do the trick:
<SPAN class="" style="color: var(--blue-800); border: 0px; font-weight: inherit; font-size: 13px;">from</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> arcgis </SPAN><SPAN class="" style="color: var(--blue-800); border: 0px; font-weight: inherit; font-size: 13px;">import</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> GIS</SPAN><SPAN class="" style="color: var(--blue-800); border: 0px; font-weight: inherit; font-size: 13px;">import</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> json</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">,</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> sys </SPAN><SPAN class="" style="color: var(--blue-800); border: 0px; font-weight: inherit; font-size: 13px;">def</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> search_item</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">(</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">conn</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">,</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">layer_name</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">):</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> search_results </SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">=</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> conn</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">.</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">content</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">.</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">search</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">(</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">layer_name</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">,</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> item_type</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">=</SPAN><SPAN class="" style="color: var(--red-800); border: 0px; font-weight: inherit; font-size: 13px;">'Web Map'</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">)</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> proper_index </SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">=</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">[</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">i </SPAN><SPAN class="" style="color: var(--blue-800); border: 0px; font-weight: inherit; font-size: 13px;">for</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> i</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">,</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> s </SPAN><SPAN class="" style="color: var(--blue-800); border: 0px; font-weight: inherit; font-size: 13px;">in</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> enumerate</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">(</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">search_results</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">)</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: var(--blue-800); border: 0px; font-weight: inherit; font-size: 13px;">if</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: var(--red-800); border: 0px; font-weight: inherit; font-size: 13px;">'"'</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">+</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">layer_name</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">+</SPAN><SPAN class="" style="color: var(--red-800); border: 0px; font-weight: inherit; font-size: 13px;">'"'</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: var(--blue-800); border: 0px; font-weight: inherit; font-size: 13px;">in</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> str</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">(</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">s</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">)]</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> found_item </SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">=</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> search_results</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">[</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">proper_index</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">[</SPAN><SPAN class="" style="color: var(--red-800); border: 0px; font-weight: inherit; font-size: 13px;">0</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">]]</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> get_item </SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">=</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> conn</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">.</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">content</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">.</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">get</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">(</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">found_item</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">.</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">id</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">)</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: var(--blue-800); border: 0px; font-weight: inherit; font-size: 13px;">return</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> get_item </SPAN><SPAN class="" style="color: var(--blue-800); border: 0px; font-weight: inherit; font-size: 13px;">def</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> update_wm_layerdef</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">(</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">item</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">):</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> item_data </SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">=</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> item</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">.</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">get_data</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">()</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: var(--blue-800); border: 0px; font-weight: inherit; font-size: 13px;">print</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">(</SPAN><SPAN class="" style="color: var(--red-800); border: 0px; font-weight: inherit; font-size: 13px;">"*******************ORIGINAL DEFINITION*********************"</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">)</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: var(--blue-800); border: 0px; font-weight: inherit; font-size: 13px;">print</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">(</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">json</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">.</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">dumps</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">(</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">item_data</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">,</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> indent</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">=</SPAN><SPAN class="" style="color: var(--red-800); border: 0px; font-weight: inherit; font-size: 13px;">4</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">,</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> sort_keys</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">=</SPAN><SPAN class="" style="color: var(--blue-800); border: 0px; font-weight: inherit; font-size: 13px;">True</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">))</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: var(--black-400); border: 0px; font-weight: inherit; font-size: 13px;"># Open JSON file containing symbology update</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: var(--blue-800); border: 0px; font-weight: inherit; font-size: 13px;">with</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> open</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">(</SPAN><SPAN class="" style="color: var(--red-800); border: 0px; font-weight: inherit; font-size: 13px;">'MY_JSONFILE'</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">)</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: var(--blue-800); border: 0px; font-weight: inherit; font-size: 13px;">as</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> json_data</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">:</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> data </SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">=</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> json</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">.</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">load</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">(</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">json_data</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">)</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: var(--black-400); border: 0px; font-weight: inherit; font-size: 13px;"># Set the item_properties to include the desired update</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> item_properties </SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">=</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">{</SPAN><SPAN class="" style="color: var(--red-800); border: 0px; font-weight: inherit; font-size: 13px;">"text"</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">:</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> json</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">.</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">dumps</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">(</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">data</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">)}</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: var(--black-400); border: 0px; font-weight: inherit; font-size: 13px;"># 'Commit' the updates to the Item</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> item</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">.</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">update</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">(</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">item_properties</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">=</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">item_properties</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">)</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: var(--black-400); border: 0px; font-weight: inherit; font-size: 13px;"># Print item_data to see that changes are reflected</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> new_item_data </SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">=</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> item</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">.</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">get_data</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">()</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: var(--blue-800); border: 0px; font-weight: inherit; font-size: 13px;">print</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">(</SPAN><SPAN class="" style="color: var(--red-800); border: 0px; font-weight: inherit; font-size: 13px;">"***********************NEW DEFINITION**********************"</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">)</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: var(--blue-800); border: 0px; font-weight: inherit; font-size: 13px;">print</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">(</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">json</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">.</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">dumps</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">(</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">new_item_data</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">,</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> indent</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">=</SPAN><SPAN class="" style="color: var(--red-800); border: 0px; font-weight: inherit; font-size: 13px;">4</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">,</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> sort_keys</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">=</SPAN><SPAN class="" style="color: var(--blue-800); border: 0px; font-weight: inherit; font-size: 13px;">True</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">))</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"></SPAN><SPAN class="" style="color: var(--blue-800); border: 0px; font-weight: inherit; font-size: 13px;">def</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> main</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">():</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> conn </SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">=</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> GIS</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">(</SPAN><SPAN class="" style="color: var(--red-800); border: 0px; font-weight: inherit; font-size: 13px;">"https://arcgis.com"</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">,</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: var(--red-800); border: 0px; font-weight: inherit; font-size: 13px;">"MY_USERNAME"</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">,</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: var(--red-800); border: 0px; font-weight: inherit; font-size: 13px;">"MY_PASSWORD"</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">)</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: var(--black-400); border: 0px; font-weight: inherit; font-size: 13px;"># Search for item, get item data)</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> item </SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">=</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> search_item</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">(</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">conn</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">,</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: var(--red-800); border: 0px; font-weight: inherit; font-size: 13px;">'wm_lyrsym'</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">)</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> update_wm_layerdef</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">(</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">item</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">)</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"></SPAN><SPAN class="" style="color: var(--blue-800); border: 0px; font-weight: inherit; font-size: 13px;">if</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> __name__ </SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">==</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: var(--red-800); border: 0px; font-weight: inherit; font-size: 13px;">'__main__'</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">:</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> sys</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">.</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">exit</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">(</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">main</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">())</SPAN>where you see "MY_..." denotes where I inserted my own values in place of what the original author provided (except for https://arcgis.com for the last function).
I get this error when running the script:
<SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: 13px;">Traceback</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">(</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">most recent call last</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">):</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: 13px;">File</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: var(--red-800); border: 0px; font-weight: inherit; font-size: 13px;">"<string>"</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">,</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> line </SPAN><SPAN class="" style="color: var(--red-800); border: 0px; font-weight: inherit; font-size: 13px;">117</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">,</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: var(--blue-800); border: 0px; font-weight: inherit; font-size: 13px;">in</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"><</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">module</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">></SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: 13px;">File</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: var(--red-800); border: 0px; font-weight: inherit; font-size: 13px;">"<string>"</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">,</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> line </SPAN><SPAN class="" style="color: var(--red-800); border: 0px; font-weight: inherit; font-size: 13px;">113</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">,</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: var(--blue-800); border: 0px; font-weight: inherit; font-size: 13px;">in</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> main </SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: 13px;">File</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: var(--red-800); border: 0px; font-weight: inherit; font-size: 13px;">"<string>"</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">,</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> line </SPAN><SPAN class="" style="color: var(--red-800); border: 0px; font-weight: inherit; font-size: 13px;">85</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">,</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> </SPAN><SPAN class="" style="color: var(--blue-800); border: 0px; font-weight: inherit; font-size: 13px;">in</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> search_item</SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: 13px;">IndexError</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;">:</SPAN><SPAN class="" style="color: var(--black-750); border: 0px; font-weight: inherit; font-size: 13px;"> list index out of range</SPAN>
I suspect this is because I need to replace 'wm_lyrsym' but I did replace it with the layer name that the sybology is applied to and got the same error.
Anything I need to further alter the original script to get it to work? Here's the website I found the code on:
https://community.esri.com/groups/arcgis-python-api/blog/2019/04/09/updating-layer-symbology-with-the-arcgis-api-for-python