<?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 Auto Calculation works in Connect but not in Web Form in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/auto-calculation-works-in-connect-but-not-in-web/m-p/1192675#M43755</link>
    <description>&lt;P&gt;I have a simple formula set up in Survey123 Connect that auto-calculates a Text value based on a selected value from a previous question.&lt;/P&gt;&lt;P&gt;This works correctly in the Connect app, but when I publish to my Portal and open the Web Form, the auto-calculation is broken and only returns True or False.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;if(selected(${installation}, 'Fort A'), 'User A', '') or if(selected(${installation}, 'Fort B'), 'User B', '') or if(selected(${installation}, 'Fort C'), 'User C', '')&lt;/LI-CODE&gt;&lt;P&gt;Can anyone take a look at my formula and point me in the right direction? Thanks!&lt;/P&gt;</description>
    <pubDate>Sat, 16 Jul 2022 16:03:08 GMT</pubDate>
    <dc:creator>tigerwoulds</dc:creator>
    <dc:date>2022-07-16T16:03:08Z</dc:date>
    <item>
      <title>Auto Calculation works in Connect but not in Web Form</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/auto-calculation-works-in-connect-but-not-in-web/m-p/1192675#M43755</link>
      <description>&lt;P&gt;I have a simple formula set up in Survey123 Connect that auto-calculates a Text value based on a selected value from a previous question.&lt;/P&gt;&lt;P&gt;This works correctly in the Connect app, but when I publish to my Portal and open the Web Form, the auto-calculation is broken and only returns True or False.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;if(selected(${installation}, 'Fort A'), 'User A', '') or if(selected(${installation}, 'Fort B'), 'User B', '') or if(selected(${installation}, 'Fort C'), 'User C', '')&lt;/LI-CODE&gt;&lt;P&gt;Can anyone take a look at my formula and point me in the right direction? Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jul 2022 16:03:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/auto-calculation-works-in-connect-but-not-in-web/m-p/1192675#M43755</guid>
      <dc:creator>tigerwoulds</dc:creator>
      <dc:date>2022-07-16T16:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: Auto Calculation works in Connect but not in Web Form</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/auto-calculation-works-in-connect-but-not-in-web/m-p/1192682#M43758</link>
      <description>&lt;P&gt;In Survey123, operators like&amp;nbsp;&lt;STRONG&gt;or&amp;nbsp;&lt;/STRONG&gt;or&amp;nbsp;&lt;STRONG&gt;and&lt;/STRONG&gt;&amp;nbsp;are really meant to be used in statements that can evaluate to true or false. Frankly, I'm surprised that the formula actually works in Connect.&lt;/P&gt;&lt;P&gt;To use a series of separate conditions, you actually have to nest them so that if your "Fort A" check fails, it will then check for "Fort B", and so on. Written out, that would look like this:&lt;/P&gt;&lt;PRE&gt;if(selected(${installation}, 'Fort A'), 'User A', if(selected(${installation}, 'Fort B'), 'User B', if(selected(${installation}, 'Fort C'), 'User C', '')))&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;But honestly, it seems more like you're just replacing "Fort" with "User". If these are both string fields, you could try something like this instead:&lt;/P&gt;&lt;PRE&gt;concat('User', substr(${installation}, 4, 0))&lt;/PRE&gt;&lt;P&gt;That way even if the Fort choices expand to larger numbers, it will still work.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1657995639306.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/45975i0D02FA334935B3FE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1657995639306.png" alt="jcarlson_0-1657995639306.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jul 2022 18:20:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/auto-calculation-works-in-connect-but-not-in-web/m-p/1192682#M43758</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-07-16T18:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: Auto Calculation works in Connect but not in Web Form</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/auto-calculation-works-in-connect-but-not-in-web/m-p/1192683#M43759</link>
      <description>&lt;P&gt;Thanks, Josh. I see what you're saying about the nested conditions and will try that. I did skew the Fort and User names a bit for anonymity, they are not actually similar at all so your second suggestion will not work for me.&lt;/P&gt;&lt;P&gt;I did figure out a solution using a linked CSV table that works quite nicely. I uploaded a CSV table to my portal which acts like a lookup table. This elimates the need for nested formulas and makes it easier to manage over time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-survey123-blog/work-with-csv-data-in-arcgis-survey123/ba-p/1157642" target="_blank"&gt;Work with CSV data in ArcGIS Survey123 - Esri Community&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jul 2022 19:06:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/auto-calculation-works-in-connect-but-not-in-web/m-p/1192683#M43759</guid>
      <dc:creator>tigerwoulds</dc:creator>
      <dc:date>2022-07-16T19:06:16Z</dc:date>
    </item>
  </channel>
</rss>

