<?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 Field Calculator - Python - using 3 fields for parameters get syntax error in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/field-calculator-python-using-3-fields-for/m-p/512273#M17023</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: lbowman&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to create a model to do field calculations using 3 fields for parameters. I get the attached syntax error when I do. I'm successful in using 2 fields as parameters but when I add the 3rd, I get the error. Is there a limit or am I doing something else wrong? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Other suggestions for doing field calculations which could be easily modified by another. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Attached is the field calculator w/ code and error. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be very much appreciated. Thank you!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Nov 2012 15:43:15 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2012-11-21T15:43:15Z</dc:date>
    <item>
      <title>Field Calculator - Python - using 3 fields for parameters get syntax error</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/field-calculator-python-using-3-fields-for/m-p/512273#M17023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: lbowman&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to create a model to do field calculations using 3 fields for parameters. I get the attached syntax error when I do. I'm successful in using 2 fields as parameters but when I add the 3rd, I get the error. Is there a limit or am I doing something else wrong? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Other suggestions for doing field calculations which could be easily modified by another. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Attached is the field calculator w/ code and error. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be very much appreciated. Thank you!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Nov 2012 15:43:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/field-calculator-python-using-3-fields-for/m-p/512273#M17023</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-11-21T15:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator - Python - using 3 fields for parameters get syntax error</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/field-calculator-python-using-3-fields-for/m-p/512274#M17024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can you copy and paste your code instead of using a screen shot? It is a little difficult to make out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What are the data types of your three fields? Which field and code did you add that introduced the problem?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Nov 2012 15:54:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/field-calculator-python-using-3-fields-for/m-p/512274#M17024</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2012-11-21T15:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator - Python - using 3 fields for parameters get syntax error</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/field-calculator-python-using-3-fields-for/m-p/512275#M17025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: lbowman&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the quick reply. I thought it was adding the 3rd field but it seems that it is the 3rd field that I've added that's the problem. If I only add this one field which is a text field with coded-value domain, it fails. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Expression:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;calcCompliance(!rail_alignment!)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Code Block:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;def calcCompliance(align):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return None&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Executing (Calculate Field): CalculateField "Existing Guide Rails" compliance calcCompliance(!rail_alignment!) PYTHON_9.3 "def calcCompliance(align):\n&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return None\n"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Start Time: Wed Nov 21 13:20:35 2012&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 000539: &amp;lt;type 'exceptions.SyntaxError'&amp;gt;: invalid syntax (&amp;lt;expression&amp;gt;, line 1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (Calculate Field).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed at Wed Nov 21 13:20:35 2012 (Elapsed Time: 0.00 seconds)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I change the field used in the expression it works just fine. The field is a text field, length 25, and does contain double quotes. But one other field I tried has double quotes (but only 1 per record, the field that it fails on has some records with 2 double quotes as such:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;6" - 12" Out of Alignment. Would it be failing because of that? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let me know if you have any suggestions. Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Nov 2012 16:25:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/field-calculator-python-using-3-fields-for/m-p/512275#M17025</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-11-21T16:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator - Python - using 3 fields for parameters get syntax error</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/field-calculator-python-using-3-fields-for/m-p/512276#M17026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The problem was a field where records had 2 double quotes. Using the following for the Expression:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;calcCompliance(!rail_elem_cond!, !rail_ht!, '!rail_alignment!'.replace("\"",""))&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;solved the problem. I got this from a post on Stack Exchange.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for trying to help!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Nov 2012 17:11:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/field-calculator-python-using-3-fields-for/m-p/512276#M17026</guid>
      <dc:creator>LaureBowman</dc:creator>
      <dc:date>2012-11-21T17:11:07Z</dc:date>
    </item>
  </channel>
</rss>

