<?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 If statements and Syntax Error: Expected token ';' in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statements-and-syntax-error-expected-token/m-p/863938#M26519</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to do an if statement in a calculate field in Survey123 Connect but I keep getting the error&amp;nbsp; "Syntax Error: Expected token ';'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have any ideas what I am doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My survey&amp;nbsp;has the following parameters:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;QA field type: text&lt;/P&gt;&lt;P&gt;QB field type: text&lt;/P&gt;&lt;P&gt;Q1 field type: select yes_no&lt;/P&gt;&lt;P&gt;Q2 field type:&amp;nbsp;text&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Q2 calculation column entry: if(${Q1} = 'yes', ${QA}, ${QB})&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want the answer to Q2 to&amp;nbsp;equal QA if Q1 = yes, and to equal QB if Q1 = no.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone else have experience with this syntax error? I also get the syntax error if I try and replace ${QA} and ${QB} in the calculation field with integers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Blythe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3263"&gt;James Tedrick&lt;/A&gt;‌&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Sep 2018 17:21:38 GMT</pubDate>
    <dc:creator>BlytheSpendlove2</dc:creator>
    <dc:date>2018-09-26T17:21:38Z</dc:date>
    <item>
      <title>If statements and Syntax Error: Expected token ';'</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statements-and-syntax-error-expected-token/m-p/863938#M26519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to do an if statement in a calculate field in Survey123 Connect but I keep getting the error&amp;nbsp; "Syntax Error: Expected token ';'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have any ideas what I am doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My survey&amp;nbsp;has the following parameters:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;QA field type: text&lt;/P&gt;&lt;P&gt;QB field type: text&lt;/P&gt;&lt;P&gt;Q1 field type: select yes_no&lt;/P&gt;&lt;P&gt;Q2 field type:&amp;nbsp;text&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Q2 calculation column entry: if(${Q1} = 'yes', ${QA}, ${QB})&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want the answer to Q2 to&amp;nbsp;equal QA if Q1 = yes, and to equal QB if Q1 = no.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone else have experience with this syntax error? I also get the syntax error if I try and replace ${QA} and ${QB} in the calculation field with integers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Blythe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3263"&gt;James Tedrick&lt;/A&gt;‌&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2018 17:21:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/if-statements-and-syntax-error-expected-token/m-p/863938#M26519</guid>
      <dc:creator>BlytheSpendlove2</dc:creator>
      <dc:date>2018-09-26T17:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: If statements and Syntax Error: Expected token ';'</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statements-and-syntax-error-expected-token/m-p/863939#M26520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Blythe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The calculation syntax that you entered looks correct, but it may be due to spacing of some sort.&amp;nbsp; Please take a look at the attached example to compare to yours.&amp;nbsp; If it does not help, please attach your XLSForm to this thread.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Brandon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2018 20:09:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/if-statements-and-syntax-error-expected-token/m-p/863939#M26520</guid>
      <dc:creator>BrandonArmstrong</dc:creator>
      <dc:date>2018-09-26T20:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: If statements and Syntax Error: Expected token ';'</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statements-and-syntax-error-expected-token/m-p/863940#M26521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Brandon, you were right! It was my spacing that was giving me problems. I had a space in between "if" and the first parenthesis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Blythe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Sep 2018 15:18:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/if-statements-and-syntax-error-expected-token/m-p/863940#M26521</guid>
      <dc:creator>BlytheSpendlove2</dc:creator>
      <dc:date>2018-09-27T15:18:16Z</dc:date>
    </item>
  </channel>
</rss>

