<?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: Multiple if, for multiple values in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/multiple-if-for-multiple-values/m-p/1235409#M46243</link>
    <description>&lt;P&gt;You have 4 if statements, so you need to have 4 closing parenthesis at the end.&amp;nbsp;&lt;/P&gt;&lt;P&gt;if(selected(${prod}, 'Roundup_ProActive') and selected(${surface}, 'surface1'), '10',&lt;BR /&gt;if(selected(${prod}, 'product1') and selected(${surface}, 'surface2'), '20', if(selected(${prod}, 'product2') and selected(${surface}, 'surface1'), '100', if(selected(${prod}, 'product1') and selected(${surface}, 'surface2'), '200', '11'))))&lt;/P&gt;</description>
    <pubDate>Mon, 28 Nov 2022 14:58:49 GMT</pubDate>
    <dc:creator>JenniferAcunto</dc:creator>
    <dc:date>2022-11-28T14:58:49Z</dc:date>
    <item>
      <title>Multiple if, for multiple values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/multiple-if-for-multiple-values/m-p/1235322#M46233</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am failing calculating multiple if and I can't understand why.&lt;/P&gt;&lt;P&gt;I tried multiple syntax but this one maybe will let you understand better what I would like to do.&lt;/P&gt;&lt;P&gt;I want to: if select a productname and a surface it should return&amp;nbsp;a value, otherwise another, in the same way, if another product is selected with the same surface, it has to return another value, otherwise again another value.&lt;/P&gt;&lt;P&gt;if(selected(${prod}, 'product1') and selected(${surface}, 'surface1'), '10', '20'), if(selected(${prod}, product2') and selected(${surface}, 'surface2'), '100', '200')&lt;/P&gt;&lt;P&gt;I always get an error. Any help would be appreciated.&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2022 11:08:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/multiple-if-for-multiple-values/m-p/1235322#M46233</guid>
      <dc:creator>Iron_Mark</dc:creator>
      <dc:date>2022-11-28T11:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple if, for multiple values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/multiple-if-for-multiple-values/m-p/1235367#M46235</link>
      <description>&lt;P&gt;The second if statement is technically a part of the first if statement (it is the 'else'). So you will need to move the closing parenthesis for the first if statement to the very end.&amp;nbsp;&lt;/P&gt;&lt;P&gt;if(selected(${prod}, 'product1') and selected(${surface}, 'surface1'), '10', if(selected(${prod}, product2') and selected(${surface}, 'surface2'), '100', '200')&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2022 13:59:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/multiple-if-for-multiple-values/m-p/1235367#M46235</guid>
      <dc:creator>JenniferAcunto</dc:creator>
      <dc:date>2022-11-28T13:59:11Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple if, for multiple values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/multiple-if-for-multiple-values/m-p/1235368#M46236</link>
      <description>&lt;P&gt;What are you doing this in, Arcade, Survey123, etc? You have a default else value (20) in your first statement, if the condition is not true, so the second if statement would make no logical sense as an alternative to the first; also, can't be on the same line, although unclear if that's how it's set in your code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What it appears you're doing is setting some value such that&lt;BR /&gt;&lt;EM&gt;if selection&amp;nbsp;&lt;/EM&gt;&lt;EM&gt;= Jedi then Light, else Dark&lt;/EM&gt;&lt;BR /&gt;and also saying&lt;BR /&gt;&lt;EM&gt;if selection = human, then organic, else droid&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;This can work as separate if statements, but if you're setting one value/text/etc, the second one will always overwrite the first no matter what. You might look at nesting them.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2022 13:55:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/multiple-if-for-multiple-values/m-p/1235368#M46236</guid>
      <dc:creator>ZenMasterZeke</dc:creator>
      <dc:date>2022-11-28T13:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple if, for multiple values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/multiple-if-for-multiple-values/m-p/1235372#M46238</link>
      <description>&lt;P&gt;Hi Jennifer,&lt;/P&gt;&lt;P&gt;By doing this it sais that "if requires 3 arguments. Only 4 provided"&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2022 14:00:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/multiple-if-for-multiple-values/m-p/1235372#M46238</guid>
      <dc:creator>Iron_Mark</dc:creator>
      <dc:date>2022-11-28T14:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple if, for multiple values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/multiple-if-for-multiple-values/m-p/1235383#M46239</link>
      <description>&lt;P&gt;you need your first if condition (is this true), your second if condition (if the first one is false, is this one true), and then your default answer (if both are false provide this)....so those are the three arguments you need. Make sure you don't have anything else in your calculation.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2022 14:11:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/multiple-if-for-multiple-values/m-p/1235383#M46239</guid>
      <dc:creator>JenniferAcunto</dc:creator>
      <dc:date>2022-11-28T14:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple if, for multiple values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/multiple-if-for-multiple-values/m-p/1235402#M46240</link>
      <description>&lt;P&gt;Hi Greg,&lt;/P&gt;&lt;P&gt;Nice creativity with the example.&lt;/P&gt;&lt;P&gt;I am doind this with survey123 as the community suggest. I am completely stuck with this now..&lt;/P&gt;&lt;P&gt;this is the further I could go.....&lt;/P&gt;&lt;P&gt;if(selected(${prod}, 'product1') and selected(${surface}, 'surface1'), '10', if(selected(${prod}, 'product1') and selected(${surface}, 'surface2'), '20', '11'))&lt;/P&gt;&lt;P&gt;By doing this it works (the alternative value 11 doesn't make sense, but at least make it works).&lt;/P&gt;&lt;P&gt;Still it is missing the whole second part with product2 and surface2. If I copy and paste the first part changing the names it gives an error....&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2022 14:46:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/multiple-if-for-multiple-values/m-p/1235402#M46240</guid>
      <dc:creator>Iron_Mark</dc:creator>
      <dc:date>2022-11-28T14:46:00Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple if, for multiple values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/multiple-if-for-multiple-values/m-p/1235404#M46241</link>
      <description>&lt;P&gt;if(selected(${prod}, 'Roundup_ProActive') and selected(${surface}, 'surface1'), '10', if(selected(${prod}, 'product1') and selected(${surface}, 'surface2'), '20', if(selected(${prod}, 'product2') and selected(${surface}, 'surface1'), '100', if(selected(${prod}, 'product1') and selected(${surface}, 'surface2'), '200', '11'))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It only works the first part (with a non sense element such 11):&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if(selected(${prod}, 'product1') and selected(${surface}, 'surface1'), '10', if(selected(${prod}, 'product1') and selected(${surface}, 'surface2'), '20', '11'))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Really don't know what to do.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2022 14:49:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/multiple-if-for-multiple-values/m-p/1235404#M46241</guid>
      <dc:creator>Iron_Mark</dc:creator>
      <dc:date>2022-11-28T14:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple if, for multiple values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/multiple-if-for-multiple-values/m-p/1235409#M46243</link>
      <description>&lt;P&gt;You have 4 if statements, so you need to have 4 closing parenthesis at the end.&amp;nbsp;&lt;/P&gt;&lt;P&gt;if(selected(${prod}, 'Roundup_ProActive') and selected(${surface}, 'surface1'), '10',&lt;BR /&gt;if(selected(${prod}, 'product1') and selected(${surface}, 'surface2'), '20', if(selected(${prod}, 'product2') and selected(${surface}, 'surface1'), '100', if(selected(${prod}, 'product1') and selected(${surface}, 'surface2'), '200', '11'))))&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2022 14:58:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/multiple-if-for-multiple-values/m-p/1235409#M46243</guid>
      <dc:creator>JenniferAcunto</dc:creator>
      <dc:date>2022-11-28T14:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple if, for multiple values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/multiple-if-for-multiple-values/m-p/1235416#M46245</link>
      <description>&lt;P&gt;Jen&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We did it! &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a million! In the end I just put the 4 parenthesis and it worked.&lt;/P&gt;&lt;P&gt;Big Hug&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2022 15:05:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/multiple-if-for-multiple-values/m-p/1235416#M46245</guid>
      <dc:creator>Iron_Mark</dc:creator>
      <dc:date>2022-11-28T15:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple if, for multiple values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/multiple-if-for-multiple-values/m-p/1235417#M46246</link>
      <description>&lt;P&gt;YAY&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2022 15:06:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/multiple-if-for-multiple-values/m-p/1235417#M46246</guid>
      <dc:creator>JenniferAcunto</dc:creator>
      <dc:date>2022-11-28T15:06:36Z</dc:date>
    </item>
  </channel>
</rss>

