<?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: Arcade syntax - When() and &amp;amp;&amp;amp; in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-syntax-when-and-amp-amp/m-p/1186593#M46642</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_0-1656307083200.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/44471i22B10C17BCEE2550/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_0-1656307083200.png" alt="JohannesLindner_0-1656307083200.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The When() function is set up correctly. If you don't get output, try these:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Make sure you actually included the expression in your form&lt;/LI&gt;&lt;LI&gt;Make sure your field names are correct and that you use the actual names, not the aliases&lt;/LI&gt;&lt;LI&gt;try using 22222.0 (a double) as default value&lt;/LI&gt;&lt;LI&gt;try the written-out version of When():&lt;/LI&gt;&lt;/UL&gt;&lt;LI-CODE lang="javascript"&gt;var A = $feature.A
var B = $feature["B_B"]

if(A=='010417192124' &amp;amp;&amp;amp; B == 'Pre2000s') {
    return 2.3
}
return 22222&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;does that have to be a number or can I put 'No value'&lt;/SPAN&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;It has to be a number. So either a default value like your 22222 (or the more common 99999) or you could return null, which leaves the field empty.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jun 2022 05:25:18 GMT</pubDate>
    <dc:creator>JohannesLindner</dc:creator>
    <dc:date>2022-06-27T05:25:18Z</dc:date>
    <item>
      <title>Arcade syntax - When() and &amp;&amp;</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-syntax-when-and-amp-amp/m-p/1186581#M46640</link>
      <description>&lt;P&gt;Hi there, Not sure the best place to post this. Just need a fresh set of eyes. Still new to Arcade and want to get a calculated expression going in my form in MapViewer.&lt;/P&gt;&lt;P&gt;Have I set this up right? I'm not getting an output.&lt;/P&gt;&lt;P&gt;var A = $feature.A&lt;BR /&gt;var B = $feature["B_B"]&lt;/P&gt;&lt;P&gt;var PA_EF = When(&lt;BR /&gt;A=='010417192124' &amp;amp;&amp;amp; B == 'Pre2000s', 2.3, 22222)&lt;/P&gt;&lt;P&gt;return PA_EF&lt;/P&gt;&lt;P&gt;The first set of numbers there is a concatenated string. That's why I've put ''.&lt;/P&gt;&lt;P&gt;Also, this ultimately outputs into a double field. The default answer (22222), does that have to be a number or can I put 'No value'?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 03:53:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-syntax-when-and-amp-amp/m-p/1186581#M46640</guid>
      <dc:creator>Lindsay</dc:creator>
      <dc:date>2022-06-27T03:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade syntax - When() and &amp;&amp;</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-syntax-when-and-amp-amp/m-p/1186593#M46642</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_0-1656307083200.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/44471i22B10C17BCEE2550/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_0-1656307083200.png" alt="JohannesLindner_0-1656307083200.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The When() function is set up correctly. If you don't get output, try these:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Make sure you actually included the expression in your form&lt;/LI&gt;&lt;LI&gt;Make sure your field names are correct and that you use the actual names, not the aliases&lt;/LI&gt;&lt;LI&gt;try using 22222.0 (a double) as default value&lt;/LI&gt;&lt;LI&gt;try the written-out version of When():&lt;/LI&gt;&lt;/UL&gt;&lt;LI-CODE lang="javascript"&gt;var A = $feature.A
var B = $feature["B_B"]

if(A=='010417192124' &amp;amp;&amp;amp; B == 'Pre2000s') {
    return 2.3
}
return 22222&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;does that have to be a number or can I put 'No value'&lt;/SPAN&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;It has to be a number. So either a default value like your 22222 (or the more common 99999) or you could return null, which leaves the field empty.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 05:25:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-syntax-when-and-amp-amp/m-p/1186593#M46642</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-06-27T05:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade syntax - When() and &amp;&amp;</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-syntax-when-and-amp-amp/m-p/1187573#M46697</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294341"&gt;@JohannesLindner&lt;/a&gt;&amp;nbsp;. This was really helpful. I think I've been having issues because Map Viewer is slow/not always implementing the expression at the moment due to the upgrade and what I shared was a simplified/shorter version.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 22:29:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-syntax-when-and-amp-amp/m-p/1187573#M46697</guid>
      <dc:creator>Lindsay</dc:creator>
      <dc:date>2022-06-28T22:29:45Z</dc:date>
    </item>
  </channel>
</rss>

