<?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 Re: Need help with IF statement in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/need-help-with-if-statement/m-p/1071550#M35439</link>
    <description>&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a similar problem with the if statements in Survey 123 Connect but I can't seem to figure out the error by myself and I'm hoping if I can ask for any assistance from you all.&lt;/P&gt;&lt;P&gt;I'm trying to develop a scoring system where if the person selected answer A from the previous question then a score of 10 is displayed, if answered B then a score of 1, and a score of 0 for selected unknown from the previous question.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have my if statement written as:&lt;/P&gt;&lt;P&gt;if(selected(${Question1},'Yes),'10',if(selected(${Question1},'No'),'1','0'))&lt;/P&gt;&lt;P&gt;I don't have any syntax errors but no matter what answer I chose from the previous selection, it still displays 0 for me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea/help would be appreciated!! Thanks in advance!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Jun 2021 16:06:56 GMT</pubDate>
    <dc:creator>Helen_Liang</dc:creator>
    <dc:date>2021-06-23T16:06:56Z</dc:date>
    <item>
      <title>Need help with IF statement</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/need-help-with-if-statement/m-p/1071242#M35426</link>
      <description>&lt;P&gt;I have a nested If statement that checks a field then does a pull data on different csv files. It is working as intended however I need to add to it. I need a new if statement to check two fields for certain values then add in a fixed value if those two fields in a specific combination show up.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For Example in plain text: If Field "Measurement Type" = "Primary Facilities" and Field "Hot_Spot_temp" is greather than 150 set the priority field to 10.&amp;nbsp;&lt;/P&gt;&lt;P&gt;in Survey123 it should look something like this however I have butchered the syntax and I'm having a hard time figuring out where it's failing:&lt;/P&gt;&lt;P&gt;if($Thermal_Measurement_Type} = "Primary Facilities' and number(${Hot_Spot_Temp}) &amp;gt; 150, '10', 0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The entire nested if statement looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;if(${Thermal_Measurement_Type} = 'Primary Facilities', pulldata('Primary_Facilities_Priority', 'Priority', 'Rise', ${Hot_Spot_Above_Reference}), 
if(${Thermal_Measurement_Type} = 'Secondary Facilities', pulldata('Secondary_Facilities_Priority', 'Priority', 'Rise', ${Hot_Spot_Above_Reference}), 
if(${Thermal_Measurement_Type} = 'Indirect Measurements', pulldata('Indirect_Measurements_Priority', 'Priority', 'Rise', ${Hot_Spot_Above_Reference}), 
if($Thermal_Measurement_Type} = "Primary Facilities' and number(${Hot_Spot_Temp}) &amp;gt; 150, '10'), 0)))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edited the code to make it a little easier to read&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 21:58:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/need-help-with-if-statement/m-p/1071242#M35426</guid>
      <dc:creator>JeremyMoore2</dc:creator>
      <dc:date>2021-06-22T21:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with IF statement</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/need-help-with-if-statement/m-p/1071249#M35427</link>
      <description>&lt;P&gt;I think the one in bold below is an extra, remove it.&amp;nbsp; But you prob want '0' also since they are all strings.&lt;/P&gt;&lt;P&gt;if(${Thermal_Measurement_Type} = 'Primary Facilities', pulldata('Primary_Facilities_Priority', 'Priority', 'Rise', ${Hot_Spot_Above_Reference}), if(${Thermal_Measurement_Type} = 'Secondary Facilities', pulldata('Secondary_Facilities_Priority', 'Priority', 'Rise', ${Hot_Spot_Above_Reference}), if(${Thermal_Measurement_Type} = 'Indirect Measurements', pulldata('Indirect_Measurements_Priority', 'Priority', 'Rise', ${Hot_Spot_Above_Reference}), if($Thermal_Measurement_Type} = "Primary Facilities' and number(${Hot_Spot_Temp}) &amp;gt; 150, '10'&lt;STRONG&gt;)&lt;/STRONG&gt;, 0)))&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 21:58:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/need-help-with-if-statement/m-p/1071249#M35427</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2021-06-22T21:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with IF statement</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/need-help-with-if-statement/m-p/1071261#M35430</link>
      <description>&lt;P&gt;I got it to work. I had to walk away, take a break, go out to the garden and cut a head of cabbage then rewrite the logic. End the end it looks like this&lt;/P&gt;&lt;P&gt;if(${Thermal_Measurement_Type} = 'Primary Facilities' and number(${Hot_Spot_Temp}) &amp;gt; 150, '10', 0)&lt;/P&gt;&lt;P&gt;The entire nested If statement looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;if(${Thermal_Measurement_Type} = 'Primary Facilities', pulldata('Primary_Facilities_Priority', 'Priority', 'Rise', ${Hot_Spot_Above_Reference}), if(${Thermal_Measurement_Type} = 'Secondary Facilities', pulldata('Secondary_Facilities_Priority', 'Priority', 'Rise', ${Hot_Spot_Above_Reference}), if(${Thermal_Measurement_Type} = 'Indirect Measurements', pulldata('Indirect_Measurements_Priority', 'Priority', 'Rise', ${Hot_Spot_Above_Reference}), if(${Thermal_Measurement_Type} = 'Primary Facilities' and number(${Hot_Spot_Temp}) &amp;gt; 150, '10',  0))))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I love code and hate it at the same time. Thank you for your help&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 22:09:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/need-help-with-if-statement/m-p/1071261#M35430</guid>
      <dc:creator>JeremyMoore2</dc:creator>
      <dc:date>2021-06-22T22:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with IF statement</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/need-help-with-if-statement/m-p/1071276#M35431</link>
      <description>&lt;P&gt;Yep that was the one I bolded.&amp;nbsp; You are prob going to want '0' though.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 22:42:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/need-help-with-if-statement/m-p/1071276#M35431</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2021-06-22T22:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with IF statement</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/need-help-with-if-statement/m-p/1071277#M35432</link>
      <description>&lt;P&gt;You're right again. Ty Much&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 22:46:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/need-help-with-if-statement/m-p/1071277#M35432</guid>
      <dc:creator>JeremyMoore2</dc:creator>
      <dc:date>2021-06-22T22:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with IF statement</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/need-help-with-if-statement/m-p/1071550#M35439</link>
      <description>&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a similar problem with the if statements in Survey 123 Connect but I can't seem to figure out the error by myself and I'm hoping if I can ask for any assistance from you all.&lt;/P&gt;&lt;P&gt;I'm trying to develop a scoring system where if the person selected answer A from the previous question then a score of 10 is displayed, if answered B then a score of 1, and a score of 0 for selected unknown from the previous question.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have my if statement written as:&lt;/P&gt;&lt;P&gt;if(selected(${Question1},'Yes),'10',if(selected(${Question1},'No'),'1','0'))&lt;/P&gt;&lt;P&gt;I don't have any syntax errors but no matter what answer I chose from the previous selection, it still displays 0 for me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea/help would be appreciated!! Thanks in advance!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 16:06:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/need-help-with-if-statement/m-p/1071550#M35439</guid>
      <dc:creator>Helen_Liang</dc:creator>
      <dc:date>2021-06-23T16:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with IF statement</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/need-help-with-if-statement/m-p/1071558#M35441</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Looks ok to me.&amp;nbsp; My guess is that the built in lists are Yes No in the label but yes no for the name field.&amp;nbsp; Data always stores the name - It is case sensitive which is why you get 0.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Why in the world the default list is diff cases I have no idea.&amp;nbsp; I strongly encourage you to make both the name and label the same or it will drive&amp;nbsp;you nuts for years.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope that is it.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 16:16:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/need-help-with-if-statement/m-p/1071558#M35441</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2021-06-23T16:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with IF statement</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/need-help-with-if-statement/m-p/1071561#M35442</link>
      <description>&lt;P&gt;OMG thank you so much!! That was the problem!!&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will remember to keep them the same in the future so I don't run into the same problem again!!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 16:20:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/need-help-with-if-statement/m-p/1071561#M35442</guid>
      <dc:creator>Helen_Liang</dc:creator>
      <dc:date>2021-06-23T16:20:56Z</dc:date>
    </item>
  </channel>
</rss>

