<?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: Trigger calculations when coded domain selected by user in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/trigger-calculations-when-coded-domain-selected-by/m-p/870647#M28056</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't use an equal sign (=) that is asking Excel to do the calculation, not Survey123.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 May 2017 22:01:34 GMT</pubDate>
    <dc:creator>JamesTedrick</dc:creator>
    <dc:date>2017-05-03T22:01:34Z</dc:date>
    <item>
      <title>Trigger calculations when coded domain selected by user</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/trigger-calculations-when-coded-domain-selected-by/m-p/870642#M28051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am creating a form and have a field with the following coded values:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Circular
2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Arch
3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Square
4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Open Square
5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Open Arch
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each of those coded values should have a calculation associated with it. for instance, if user selects "Circular" then survey123 would automatically trigger the following equation (knowing that we have some of the variables in other fields):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;V=πr2h&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Is it possible in survey 123?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:51:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/trigger-calculations-when-coded-domain-selected-by/m-p/870642#M28051</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T10:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger calculations when coded domain selected by user</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/trigger-calculations-when-coded-domain-selected-by/m-p/870643#M28052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alex,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are a couple of ways, depending on how you plan to store the results of the calculation. &amp;nbsp;If they can be in separate fields, you can make a question for each formula that has a relevant statement set to only present the question with the proper choice selected. &amp;nbsp;If they need to be stored in the same field, you would use a series of nested if() functions to check which value is selected and then execute the appropriate function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 May 2017 23:11:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/trigger-calculations-when-coded-domain-selected-by/m-p/870643#M28052</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2017-05-02T23:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger calculations when coded domain selected by user</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/trigger-calculations-when-coded-domain-selected-by/m-p/870644#M28053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would rather have the second option in my form. Where would I plug in these nested if() in my form? &amp;nbsp;And would it be something like &amp;nbsp;(in python? in the follwing example I am using JS):&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;if (${SW_TYPE_SHAPE} = "codedvalue"){
code goes here
}
else if(${SW_TYPE_SHAPE} = "codedvalue"){
code goes here
}‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:51:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/trigger-calculations-when-coded-domain-selected-by/m-p/870644#M28053</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T10:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger calculations when coded domain selected by user</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/trigger-calculations-when-coded-domain-selected-by/m-p/870645#M28054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alex,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This would be placed in the calculation column and would actually be more like how Excel specifies this (nested evaluators):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(${SW_TYPE_SHAPE} = "1", &amp;lt;function1&amp;gt;, if(&lt;SPAN&gt;${SW_TYPE_SHAPE} = "2", &amp;lt;function2&amp;gt;, ...))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 May 2017 00:39:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/trigger-calculations-when-coded-domain-selected-by/m-p/870645#M28054</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2017-05-03T00:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger calculations when coded domain selected by user</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/trigger-calculations-when-coded-domain-selected-by/m-p/870646#M28055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/349485_pastedImage_2.png" style="width: 620px; height: 151px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems like Excel does not like the $ . What am I doing wrong here?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 May 2017 21:42:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/trigger-calculations-when-coded-domain-selected-by/m-p/870646#M28055</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2017-05-03T21:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger calculations when coded domain selected by user</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/trigger-calculations-when-coded-domain-selected-by/m-p/870647#M28056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't use an equal sign (=) that is asking Excel to do the calculation, not Survey123.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 May 2017 22:01:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/trigger-calculations-when-coded-domain-selected-by/m-p/870647#M28056</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2017-05-03T22:01:34Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger calculations when coded domain selected by user</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/trigger-calculations-when-coded-domain-selected-by/m-p/870648#M28057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One last thing. Sorry I am not familiar with this. I get that error&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/349567_pastedImage_1.png" style="width: 620px; height: 161px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When entering the formula this way:&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;if(${SW_TYPE_SHAPE} = "1", &amp;lt;function1&amp;gt;, if(&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; border: 0px;"&gt;${SW_TYPE_SHAPE} = "2", &amp;lt;function2&amp;gt;, ...))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems like it cannot navigate to the "choices" sheet. I am not too sure how to reference that&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;SW_TYPE_SHAPE.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Alex&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 May 2017 15:37:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/trigger-calculations-when-coded-domain-selected-by/m-p/870648#M28057</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2017-05-04T15:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger calculations when coded domain selected by user</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/trigger-calculations-when-coded-domain-selected-by/m-p/870649#M28058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The string within the curly brackets references an existing question within your form. Simply put the NAME of the question in your form that holds the values for the shape type and you should be good. The error you are getting indicates that your formula is referencing a question named SW_TYPE_SHAPE, which is not present&amp;nbsp; in your XLSfile.&amp;nbsp; Please note that questions are referenced through the value&amp;nbsp; in the NAME column, not the LABEL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These links show in more detail how to use formulas in Survey123&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/groups/survey123/blog/2016/09/06/new-mathematical-functions-make-your-form-smarter"&gt;https://community.esri.com/groups/survey123/blog/2016/09/06/new-mathematical-functions-make-your-form-smarter&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm" title="https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm"&gt;Formulas—Survey123 for ArcGIS | ArcGIS&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The &lt;EM&gt;Calculations&lt;/EM&gt; sample form is also a good reference to get started with expressions in Survey123. You can create a dummy form using this sample and then look at the XLSFile to learn the syntax&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="349576" alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/349576_Untitled.png" style="width: 620px; height: 391px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 May 2017 15:48:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/trigger-calculations-when-coded-domain-selected-by/m-p/870649#M28058</guid>
      <dc:creator>IsmaelChivite</dc:creator>
      <dc:date>2017-05-04T15:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger calculations when coded domain selected by user</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/trigger-calculations-when-coded-domain-selected-by/m-p/870650#M28059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alex,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Without seeing your Excel sheet, I can't be certain. &amp;nbsp;The cropped image provided above does not have a question named SW_TYPE_SHAPE, and the labels don't distinguish which question is which. &amp;nbsp;What is the name of the question with values you are evaluating (I was simply copying from what you provided as an example)?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 May 2017 15:49:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/trigger-calculations-when-coded-domain-selected-by/m-p/870650#M28059</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2017-05-04T15:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger calculations when coded domain selected by user</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/trigger-calculations-when-coded-domain-selected-by/m-p/870651#M28060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Ismael for the good calculation samples you provided. That will be very useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;James, Thank you for your help. I was not referencing the domain choice name not the actual form question. The issue is solved. I can now enter the formulas in nested IF statements. Great product by the way.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 May 2017 16:49:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/trigger-calculations-when-coded-domain-selected-by/m-p/870651#M28060</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2017-05-04T16:49:51Z</dc:date>
    </item>
  </channel>
</rss>

