<?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 Script stopped working properly with upgrade of ArcGIS Pro in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/script-stopped-working-properly-with-upgrade-of/m-p/1055207#M61052</link>
    <description>&lt;P&gt;I created a Python script that calculates fields of newly added points. When I run the script in ArcGIS Pro 2.5 everything works correctly, but when I upgraded to version 2.7.3 of Pro, 3 of the fields no longer populate. I don't get any errors from the script. Thanks in advance for any help!&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

#Setup the user inputs
customerPointSelection = arcpy.GetParameterAsText(0)
customerPoint = arcpy.GetParameterAsText(1)
automatedCollection = arcpy.GetParameterAsText(2)

#Create a spatial join between customerPointSelection and automatedCollection
arcpy.SpatialJoin_analysis(customerPointSelection, automatedCollection, "in_memory/CustomerAutoJoin", "JOIN_ONE_TO_MANY","KEEP_COMMON","","WITHIN")
#Create a new join to the customerPoint
arcpy.AddJoin_management(customerPoint,"OBJECTID","in_memory/CustomerAutoJoin","TARGET_FID","KEEP_COMMON")
#Calculate the needed fields
arcpy.CalculateField_management(customerPoint,"SEC_NAME","!CustomerAutoJoin.SEC_NAME_1!","PYTHON3","","TEXT")
arcpy.CalculateField_management(customerPoint,"COLLECT_DAY","!CustomerAutoJoin.DAY!","PYTHON3","","TEXT")
arcpy.management.CalculateField(customerPoint,"QUAD","!CustomerAutoJoin.QUAD_1!","PYTHON3","","TEXT")
arcpy.CalculateField_management(customerPoint,"HELP_SECTION","!CustomerAutoJoin.HELP_SECTION_1!","PYTHON3","","SHORT")
#Remove the join and delete the in memory feature
arcpy.RemoveJoin_management(customerPoint)
arcpy.Delete_management("in_memory/CustomerAutoJoin")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 06 May 2021 13:54:31 GMT</pubDate>
    <dc:creator>michael_vetter</dc:creator>
    <dc:date>2021-05-06T13:54:31Z</dc:date>
    <item>
      <title>Script stopped working properly with upgrade of ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/script-stopped-working-properly-with-upgrade-of/m-p/1055207#M61052</link>
      <description>&lt;P&gt;I created a Python script that calculates fields of newly added points. When I run the script in ArcGIS Pro 2.5 everything works correctly, but when I upgraded to version 2.7.3 of Pro, 3 of the fields no longer populate. I don't get any errors from the script. Thanks in advance for any help!&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

#Setup the user inputs
customerPointSelection = arcpy.GetParameterAsText(0)
customerPoint = arcpy.GetParameterAsText(1)
automatedCollection = arcpy.GetParameterAsText(2)

#Create a spatial join between customerPointSelection and automatedCollection
arcpy.SpatialJoin_analysis(customerPointSelection, automatedCollection, "in_memory/CustomerAutoJoin", "JOIN_ONE_TO_MANY","KEEP_COMMON","","WITHIN")
#Create a new join to the customerPoint
arcpy.AddJoin_management(customerPoint,"OBJECTID","in_memory/CustomerAutoJoin","TARGET_FID","KEEP_COMMON")
#Calculate the needed fields
arcpy.CalculateField_management(customerPoint,"SEC_NAME","!CustomerAutoJoin.SEC_NAME_1!","PYTHON3","","TEXT")
arcpy.CalculateField_management(customerPoint,"COLLECT_DAY","!CustomerAutoJoin.DAY!","PYTHON3","","TEXT")
arcpy.management.CalculateField(customerPoint,"QUAD","!CustomerAutoJoin.QUAD_1!","PYTHON3","","TEXT")
arcpy.CalculateField_management(customerPoint,"HELP_SECTION","!CustomerAutoJoin.HELP_SECTION_1!","PYTHON3","","SHORT")
#Remove the join and delete the in memory feature
arcpy.RemoveJoin_management(customerPoint)
arcpy.Delete_management("in_memory/CustomerAutoJoin")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 13:54:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-stopped-working-properly-with-upgrade-of/m-p/1055207#M61052</guid>
      <dc:creator>michael_vetter</dc:creator>
      <dc:date>2021-05-06T13:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: Script stopped working properly with upgrade of ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/script-stopped-working-properly-with-upgrade-of/m-p/1055463#M61066</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;try &lt;STRONG&gt;management.CalculateField&lt;/STRONG&gt; for all field calculations&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;not CalculateField_management&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 06 May 2021 22:01:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-stopped-working-properly-with-upgrade-of/m-p/1055463#M61066</guid>
      <dc:creator>r3weber</dc:creator>
      <dc:date>2021-05-06T22:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: Script stopped working properly with upgrade of ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/script-stopped-working-properly-with-upgrade-of/m-p/1055514#M61068</link>
      <description>&lt;P&gt;from&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/calculate-field.htm" target="_blank" rel="noopener"&gt;Calculate Field (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can examine the code and its location and you will see that both methods lead to the exact same function in the same file.&amp;nbsp; The "dot notation" is now preferred but the other is still usable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcpy import CalculateField_management

from arcpy.management import CalculateField

# ---- use help on either one

Source:   
@gptooldoc('CalculateField_management', None)
def CalculateField(in_table=None, field=None, expression=None, expression_type=None, code_block=None, field_type=None, enforce_domains=None):
.... snip ....
File:      c:\arc_pro\resources\arcpy\arcpy\management.py
Type:      function&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 23:26:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-stopped-working-properly-with-upgrade-of/m-p/1055514#M61068</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-05-06T23:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: Script stopped working properly with upgrade of ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/script-stopped-working-properly-with-upgrade-of/m-p/1055616#M61075</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;This example works for me using the latest base arcgis pro python environment...so that's all I got!&amp;nbsp; Good luck.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;fieldName&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;r&lt;/SPAN&gt;&lt;SPAN&gt;'SYS_TRANSFER_DATE'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;expression&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;f&lt;/SPAN&gt;&lt;SPAN&gt;"'&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;SPAN&gt;current_utc&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;'&amp;nbsp;if&amp;nbsp;!SYS_TRANSFER_DATE!&amp;nbsp;is&amp;nbsp;None&amp;nbsp;else&amp;nbsp;!SYS_TRANSFER_DATE!"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;arcpy.CalculateField_management(workspace,&amp;nbsp;fieldName,&amp;nbsp;expression,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"PYTHON3"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 07 May 2021 12:50:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-stopped-working-properly-with-upgrade-of/m-p/1055616#M61075</guid>
      <dc:creator>r3weber</dc:creator>
      <dc:date>2021-05-07T12:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: Script stopped working properly with upgrade of ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/script-stopped-working-properly-with-upgrade-of/m-p/1056486#M61086</link>
      <description>&lt;P&gt;Thank you &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/417697"&gt;@r3weber&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/215600"&gt;@DanPatterson&lt;/a&gt;&amp;nbsp;for suggesting using the dot notation. I changed the script to include the dot notation and was getting the same results. I looked at the results from the spatial join layer and the spatial join layer isn't getting all the attributes from the polygon layer, but I'm not exactly sure why some of the fields aren't getting populated even though the polygon layer has attributes for those fields.&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 23:19:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-stopped-working-properly-with-upgrade-of/m-p/1056486#M61086</guid>
      <dc:creator>michael_vetter</dc:creator>
      <dc:date>2021-05-10T23:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: Script stopped working properly with upgrade of ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/script-stopped-working-properly-with-upgrade-of/m-p/1056661#M61090</link>
      <description>&lt;P&gt;I've had mixed results between using 'in_memory' and 'memory' with python 3 scripts.&amp;nbsp; Some work with using&amp;nbsp; 'memory' and others work with using 'in_memory'. If you haven't already, try just 'memory' or writing to disk to see the results at each step.&lt;/P&gt;&lt;P&gt;I've also had mixed results with using dot notation while using pycharm. Ran as a script tool, it works but when I run it externally as a standalone script it throws errors.&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 13:43:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/script-stopped-working-properly-with-upgrade-of/m-p/1056661#M61090</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-05-11T13:43:31Z</dc:date>
    </item>
  </channel>
</rss>

