<?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: Formatting if statements for relevant column: what are 'yes' and 'no?' in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/formatting-if-statements-for-relevant-column-what/m-p/1296195#M49721</link>
    <description>&lt;P&gt;The output of the if statement is a simple string so you could put anything there. If you would like to use the labels of the selected options then you could use jr:choice-name(${Q1}, '${Q1}').&lt;/P&gt;</description>
    <pubDate>Tue, 06 Jun 2023 12:39:09 GMT</pubDate>
    <dc:creator>Nicole_Ueberschär</dc:creator>
    <dc:date>2023-06-06T12:39:09Z</dc:date>
    <item>
      <title>Formatting if statements for relevant column: what are 'yes' and 'no?'</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/formatting-if-statements-for-relevant-column-what/m-p/1295727#M49674</link>
      <description>&lt;P&gt;I am new to excel syntax. I learned that the if statement should be formatted if(condition, a, b) as in the Esri docs screenshotted below. This is for the relevant field of a question.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LydiaYoungblood_0-1685960134168.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/72327iF4284F2AE3440D50/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LydiaYoungblood_0-1685960134168.png" alt="LydiaYoungblood_0-1685960134168.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;LydiaYoungblood_0-1685960134168.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The problem is, it is unclear to me what this 'yes', 'no' is. Does this refer to my particular choice names? or is it a global variable? I want the if statement to be: if(condition, show the question, don't show the question).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;E.g. if my questions were about consent in the example screenshot, would I have:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if(selected(${Q1_consent}, 'Yes, I consent') and selected(${Q2_incity}, 'Yes, I live in the city'), 'Yes, I consent', 'No, I do not consent')&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;...based on what I have in my choice tab? or would it be:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;if(selected(${Q1_consent}, 'Yes, I consent') and selected(${Q2_incity}, 'Yes, I live in the city'), 'yes', 'no')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2023 10:19:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/formatting-if-statements-for-relevant-column-what/m-p/1295727#M49674</guid>
      <dc:creator>AnnaScholl</dc:creator>
      <dc:date>2023-06-05T10:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting if statements for relevant column: what are 'yes' and 'no?'</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/formatting-if-statements-for-relevant-column-what/m-p/1295740#M49677</link>
      <description>&lt;P&gt;'yes' is in this example the result for if the condition is true and 'no' the result if the condition is false.&lt;/P&gt;&lt;P&gt;For the correct if statement it is relevant what you have in the name column of your choice option. If the label says 'Yes, I consent' but the name says only 'yes', then I would assume you would like something like&lt;/P&gt;&lt;P&gt;if(selected(${Q1_consent}, 'yes') and selected(${Q2_incity}, 'yes'), 'Yes, I consent', 'No, I do not consent')&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2023 11:44:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/formatting-if-statements-for-relevant-column-what/m-p/1295740#M49677</guid>
      <dc:creator>Nicole_Ueberschär</dc:creator>
      <dc:date>2023-06-05T11:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting if statements for relevant column: what are 'yes' and 'no?'</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/formatting-if-statements-for-relevant-column-what/m-p/1295743#M49678</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/248874"&gt;@Nicole_Ueberschär&lt;/a&gt;&amp;nbsp;Nicole, thank you. So it's in your example:&lt;BR /&gt;&lt;SPAN&gt;if(selected(${Q1}, 'choice_name') and selected(${Q2}, 'choice_name'), 'label_name', 'label_name')?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2023 12:00:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/formatting-if-statements-for-relevant-column-what/m-p/1295743#M49678</guid>
      <dc:creator>AnnaScholl</dc:creator>
      <dc:date>2023-06-05T12:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting if statements for relevant column: what are 'yes' and 'no?'</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/formatting-if-statements-for-relevant-column-what/m-p/1295756#M49681</link>
      <description>&lt;P&gt;I think you are getting lost in what an if statement is and not necessarily what you need. It sounds to me like you want a field to be relevant if&amp;nbsp;&lt;SPAN&gt;${Q1_consent} is 'Yes, I consent' and ${Q2_incity} is 'Yes, I live in the city'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If that is the case and assuming that the actual choice names are 'yes', you would just need to add this in the relevant field: ${Q!_consent}='yes' and ${Q2}='yes'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;How the relevant column works is that if what you put in it evaluates to true, then the field is 'relevant' and displayed, if it is not true, then it is not displayed.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2023 12:43:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/formatting-if-statements-for-relevant-column-what/m-p/1295756#M49681</guid>
      <dc:creator>JenniferAcunto</dc:creator>
      <dc:date>2023-06-05T12:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting if statements for relevant column: what are 'yes' and 'no?'</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/formatting-if-statements-for-relevant-column-what/m-p/1295760#M49682</link>
      <description>&lt;P&gt;You were exactly right. In the end I thought I needed if statements as I had multiple criteria to run through.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ultimately I needed:&amp;nbsp;(${Q1}='yes' and ${Q2}='yes_city') or (${Q1}='yes' and ${Q2}='no_not_incity' and ${consent_gdpr}='yes_gdpr').&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&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;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2023 12:48:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/formatting-if-statements-for-relevant-column-what/m-p/1295760#M49682</guid>
      <dc:creator>AnnaScholl</dc:creator>
      <dc:date>2023-06-05T12:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting if statements for relevant column: what are 'yes' and 'no?'</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/formatting-if-statements-for-relevant-column-what/m-p/1296195#M49721</link>
      <description>&lt;P&gt;The output of the if statement is a simple string so you could put anything there. If you would like to use the labels of the selected options then you could use jr:choice-name(${Q1}, '${Q1}').&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 12:39:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/formatting-if-statements-for-relevant-column-what/m-p/1296195#M49721</guid>
      <dc:creator>Nicole_Ueberschär</dc:creator>
      <dc:date>2023-06-06T12:39:09Z</dc:date>
    </item>
  </channel>
</rss>

