<?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: Calculate field using Arcade expression in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/calculate-field-using-arcade-expression/m-p/1193961#M43819</link>
    <description>&lt;P&gt;When I use the arcade expression I end up getting this error message:&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Execution Error:&lt;/SPAN&gt;&lt;SPAN&gt;Runtime Error: Identifier Not Found. reviewed&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any thoughts?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 20 Jul 2022 14:58:19 GMT</pubDate>
    <dc:creator>Bryan_Wade</dc:creator>
    <dc:date>2022-07-20T14:58:19Z</dc:date>
    <item>
      <title>Calculate field using Arcade expression</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculate-field-using-arcade-expression/m-p/1193632#M43797</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I have a feature layer with a mishmash of values that should be the same.&amp;nbsp; IE:&amp;nbsp; Features that should be marked as "Reviewed" might be "Reviewed" or "reviewed", resulting in a legend with 4x classes instead of two?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Wade_Bryan_0-1658260007473.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/46213i2A8D7FA995FB284E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Wade_Bryan_0-1658260007473.png" alt="Wade_Bryan_0-1658260007473.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Wade_Bryan_0-1658260007473.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This issue occurred when I updated and republished my survey. It was suggested I recalculate the field using an arcade expression. I have never done this before and was hoping someone could give me an idea of how to go about it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 19:48:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculate-field-using-arcade-expression/m-p/1193632#M43797</guid>
      <dc:creator>Bryan_Wade</dc:creator>
      <dc:date>2022-07-19T19:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate field using Arcade expression</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculate-field-using-arcade-expression/m-p/1193666#M43800</link>
      <description>&lt;P&gt;If you go to the Data tab of your item and look at the Table, clicking a field heading lets you open up the Field Calculator. I would suggest using SQL for this, but either SQL or Arcade will work.&lt;/P&gt;&lt;P&gt;Arcade:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var s = $feature.status

return When(
    Find('ubmitted', s) != -1, 'Submitted',
    Find('eviewed', s) != -1, 'Reviewed',
    s
)&lt;/LI-CODE&gt;&lt;P&gt;By using&amp;nbsp;&lt;STRONG&gt;Find&lt;/STRONG&gt;, we can tell our expression to return "Submitted" any time it finds 'ubmitted' in the field value and so on, which would account for capitals, extra spaces at the beginning / end.&lt;/P&gt;&lt;P&gt;In SQL, we can use&amp;nbsp;&lt;STRONG&gt;LIKE&lt;/STRONG&gt;, which is a bit more straightforward to me, but works on the same principal:&lt;/P&gt;&lt;LI-CODE lang="sql"&gt;CASE
WHEN status LIKE '%ubmitted%' THEN 'Submitted'
WHEN status LIKE '%eviewed%' THEN 'Reviewed'
ELSE status
END&lt;/LI-CODE&gt;&lt;P&gt;In both cases, we leave unmatched values at their initial value. The lists of conditions can easily be expanded for other statuses.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 20:58:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculate-field-using-arcade-expression/m-p/1193666#M43800</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-07-19T20:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate field using Arcade expression</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculate-field-using-arcade-expression/m-p/1193961#M43819</link>
      <description>&lt;P&gt;When I use the arcade expression I end up getting this error message:&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Execution Error:&lt;/SPAN&gt;&lt;SPAN&gt;Runtime Error: Identifier Not Found. reviewed&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any thoughts?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2022 14:58:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculate-field-using-arcade-expression/m-p/1193961#M43819</guid>
      <dc:creator>Bryan_Wade</dc:creator>
      <dc:date>2022-07-20T14:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate field using Arcade expression</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculate-field-using-arcade-expression/m-p/1193994#M43826</link>
      <description>&lt;P&gt;What's the actual expression you're using?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2022 15:27:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculate-field-using-arcade-expression/m-p/1193994#M43826</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-07-20T15:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate field using Arcade expression</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculate-field-using-arcade-expression/m-p/1194121#M43830</link>
      <description>&lt;P&gt;I was able to get it to work. but when I go to the map I'm still getting this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Wade_Bryan_0-1658345368085.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/46331i2A169A3A5A7A34F7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Wade_Bryan_0-1658345368085.png" alt="Wade_Bryan_0-1658345368085.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Wade_Bryan_0-1658345368085.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Also, the indicator tiles in my dashboard are not picking up the field 'Status' correctly. I have a tile with a filter set for reviewed and one for submitted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2022 19:32:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculate-field-using-arcade-expression/m-p/1194121#M43830</guid>
      <dc:creator>Bryan_Wade</dc:creator>
      <dc:date>2022-07-20T19:32:15Z</dc:date>
    </item>
  </channel>
</rss>

