<?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 Apply Symbology not working inside toolbox python script in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/apply-symbology-not-working-inside-toolbox-python/m-p/1565561#M73287</link>
    <description>&lt;P&gt;Hey everyone,&lt;/P&gt;&lt;P&gt;I have a python script that I wrote which creates a feature class and overwrites a feature class in my geodatabase then overwrites a feature on my enterprise portal. (11.1) Arc Pro Version 3.2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue I have is that this piece of code executes perfectly in the python window, and in a notebook. It will run in the toolbox with no errors but not update the single symbol symbology. I found a bug from 2021 but I am unsure if it was solved.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;#Apply Symbology to new layer
symbol = MP.listLayers("Symbology")[0]
Publish = MP.listLayers("Active_DN_Inspections")[0] #creates variable for layer
arcpy.management.ApplySymbologyFromLayer(
    in_layer = Publish,
    in_symbology_layer = symbol,
    symbology_fields = None,
    update_symbology = "DEFAULT"
)&lt;/LI-CODE&gt;&lt;P&gt;&lt;A href="https://support.esri.com/en-us/bug/applysymbologyfromlayer-in-a-python-script-in-arcgis-pr-bug-000116527" target="_blank"&gt;https://support.esri.com/en-us/bug/applysymbologyfromlayer-in-a-python-script-in-arcgis-pr-bug-000116527&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-pro-questions/applysymbologyfromlayer-management-inside-toolbox/m-p/1090734#M44679" target="_blank"&gt;https://community.esri.com/t5/arcgis-pro-questions/applysymbologyfromlayer-management-inside-toolbox/m-p/1090734#M44679&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 06 Dec 2024 13:36:14 GMT</pubDate>
    <dc:creator>BrandonMcAlister</dc:creator>
    <dc:date>2024-12-06T13:36:14Z</dc:date>
    <item>
      <title>Apply Symbology not working inside toolbox python script</title>
      <link>https://community.esri.com/t5/python-questions/apply-symbology-not-working-inside-toolbox-python/m-p/1565561#M73287</link>
      <description>&lt;P&gt;Hey everyone,&lt;/P&gt;&lt;P&gt;I have a python script that I wrote which creates a feature class and overwrites a feature class in my geodatabase then overwrites a feature on my enterprise portal. (11.1) Arc Pro Version 3.2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue I have is that this piece of code executes perfectly in the python window, and in a notebook. It will run in the toolbox with no errors but not update the single symbol symbology. I found a bug from 2021 but I am unsure if it was solved.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;#Apply Symbology to new layer
symbol = MP.listLayers("Symbology")[0]
Publish = MP.listLayers("Active_DN_Inspections")[0] #creates variable for layer
arcpy.management.ApplySymbologyFromLayer(
    in_layer = Publish,
    in_symbology_layer = symbol,
    symbology_fields = None,
    update_symbology = "DEFAULT"
)&lt;/LI-CODE&gt;&lt;P&gt;&lt;A href="https://support.esri.com/en-us/bug/applysymbologyfromlayer-in-a-python-script-in-arcgis-pr-bug-000116527" target="_blank"&gt;https://support.esri.com/en-us/bug/applysymbologyfromlayer-in-a-python-script-in-arcgis-pr-bug-000116527&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-pro-questions/applysymbologyfromlayer-management-inside-toolbox/m-p/1090734#M44679" target="_blank"&gt;https://community.esri.com/t5/arcgis-pro-questions/applysymbologyfromlayer-management-inside-toolbox/m-p/1090734#M44679&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2024 13:36:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/apply-symbology-not-working-inside-toolbox-python/m-p/1565561#M73287</guid>
      <dc:creator>BrandonMcAlister</dc:creator>
      <dc:date>2024-12-06T13:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: Apply Symbology not working inside toolbox python script</title>
      <link>https://community.esri.com/t5/python-questions/apply-symbology-not-working-inside-toolbox-python/m-p/1565636#M73288</link>
      <description>&lt;P&gt;&lt;SPAN&gt;The symbology created in a script tool, the tool must include the layer as a&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/3.0/arcpy/geoprocessing_and_python/setting-script-tool-parameters.htm#GUID-8A3BFFDE-3923-4956-94D6-8960D3A68C7F" target="_blank" rel="noopener nofollow noreferrer"&gt;derived output parameter&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2024 15:31:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/apply-symbology-not-working-inside-toolbox-python/m-p/1565636#M73288</guid>
      <dc:creator>TonyAlmeida</dc:creator>
      <dc:date>2024-12-06T15:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Apply Symbology not working inside toolbox python script</title>
      <link>https://community.esri.com/t5/python-questions/apply-symbology-not-working-inside-toolbox-python/m-p/1567977#M73328</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/3265"&gt;@TonyAlmeida&lt;/a&gt;&lt;/P&gt;&lt;P&gt;After much trouble and research I was able to get it to work by doing this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;results = []
res = arcpy.management.ApplySymbologyFromLayer(
    in_layer = Publish,
    in_symbology_layer = symbol,
    symbology_fields = None,
    update_symbology = "DEFAULT"
)
results.append(res)
arcpy.SetParameter(2, results)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where parameter 2 is set up like this:&lt;/P&gt;&lt;P&gt;Label: OutputLayer&lt;/P&gt;&lt;P&gt;Data Type: Layer&lt;/P&gt;&lt;P&gt;Type: Derived&lt;/P&gt;&lt;P&gt;Direction: Output&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 18:14:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/apply-symbology-not-working-inside-toolbox-python/m-p/1567977#M73328</guid>
      <dc:creator>BrandonMcAlister</dc:creator>
      <dc:date>2024-12-12T18:14:11Z</dc:date>
    </item>
  </channel>
</rss>

