<?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 Python Scripting Problem in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-scripting-problem/m-p/615686#M48032</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dear Sir&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to replace "TextString" field attribute values with "Name_Sin" attribute values in an another table.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for that&amp;nbsp; I wrote a script to join two tables and calculate the attributes. But the expression is something wrong.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have no idea to correct it. So please&amp;nbsp; help me to correct it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Padmasiri&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration:underline;"&gt;My Script&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.MakeFeatureLayer_management("PCL_Anno", "PCL_Anno_Lyr")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.AddJoin_management("PCL_Anno_Lyr", "Text", r"C:\CMSupport.gdb\Conv_Tab", "Nam_Idm", "KEEP_ALL")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.CalculateField_management("PCL_Anno_Lyr", "TextString", "!TextString! = !Name_Sin!", "PYTHON_9.3", "")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.CopyFeatures_management("PCL_Anno_Lyr", "PCL_Anno_New")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Error Message&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "E:\Gampaha\Scripts\Script1.py", line 89, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CalculateField_management("PCL_Anno_Lyr", "TextString", "!TextString! = !Name_Sin!", "PYTHON_9.3", "")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\management.py", line 3128, in CalculateField&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise e&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ExecuteError: ERROR 000539: SyntaxError: invalid syntax (&amp;lt;expression&amp;gt;, line 1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (CalculateField).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (LISTool1.0).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Mar 2014 16:48:32 GMT</pubDate>
    <dc:creator>H_A_D_Padmasiri</dc:creator>
    <dc:date>2014-03-13T16:48:32Z</dc:date>
    <item>
      <title>Python Scripting Problem</title>
      <link>https://community.esri.com/t5/python-questions/python-scripting-problem/m-p/615686#M48032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dear Sir&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to replace "TextString" field attribute values with "Name_Sin" attribute values in an another table.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for that&amp;nbsp; I wrote a script to join two tables and calculate the attributes. But the expression is something wrong.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have no idea to correct it. So please&amp;nbsp; help me to correct it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Padmasiri&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration:underline;"&gt;My Script&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.MakeFeatureLayer_management("PCL_Anno", "PCL_Anno_Lyr")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.AddJoin_management("PCL_Anno_Lyr", "Text", r"C:\CMSupport.gdb\Conv_Tab", "Nam_Idm", "KEEP_ALL")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.CalculateField_management("PCL_Anno_Lyr", "TextString", "!TextString! = !Name_Sin!", "PYTHON_9.3", "")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.CopyFeatures_management("PCL_Anno_Lyr", "PCL_Anno_New")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Error Message&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "E:\Gampaha\Scripts\Script1.py", line 89, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CalculateField_management("PCL_Anno_Lyr", "TextString", "!TextString! = !Name_Sin!", "PYTHON_9.3", "")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\management.py", line 3128, in CalculateField&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise e&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ExecuteError: ERROR 000539: SyntaxError: invalid syntax (&amp;lt;expression&amp;gt;, line 1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (CalculateField).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (LISTool1.0).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2014 16:48:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-scripting-problem/m-p/615686#M48032</guid>
      <dc:creator>H_A_D_Padmasiri</dc:creator>
      <dc:date>2014-03-13T16:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: Python Scripting Problem</title>
      <link>https://community.esri.com/t5/python-questions/python-scripting-problem/m-p/615687#M48033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think there are two problems.&amp;nbsp; First, the expression you enter need only be what you would use in field calculator, i.e. "!Name_Sin!", instead of "!TextString! = !Name_Sin!".&amp;nbsp; Second, when you have a joined table, the name of the feature class and a period are added to the field name as a prefix.&amp;nbsp; So, when you have this table joined, you will want to write "!&amp;lt;feature class name&amp;gt;.Name_Sin!".&amp;nbsp; The easiest way to double check this is to perform the join in ArcMap, and then open the table and view the properties of various fields to see their respective names.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope that solves it!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Adam&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2014 17:54:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-scripting-problem/m-p/615687#M48033</guid>
      <dc:creator>AdamCox1</dc:creator>
      <dc:date>2014-03-13T17:54:29Z</dc:date>
    </item>
  </channel>
</rss>

