<?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 When Function Execution Error in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-when-function-execution-error/m-p/1092378#M41892</link>
    <description>&lt;P&gt;What you could do is something like this&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var array = ['ArapCycles', 'ArapFlow'];
var output;
for (var i in array) {
output += $feature[$feature.wellLocation + array[i]] + TextFormatting.NewLine;
}
return output;&lt;/LI-CODE&gt;&lt;P&gt;This is how it works in the Playground&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="arcade1.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/21708i90920B8B3B9554B8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="arcade1.png" alt="arcade1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;</description>
    <pubDate>Wed, 25 Aug 2021 18:24:31 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2021-08-25T18:24:31Z</dc:date>
    <item>
      <title>Arcade When Function Execution Error</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-when-function-execution-error/m-p/1092263#M41882</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm working on a Pop-Up configuration using an Arcade expression to display related fields based on attributes in another field. I'm trying to use a When expression that states, when the well location field equals a particular string, display related fields, otherwise display nothing. There are multiple related fields associated with one well location.&lt;/P&gt;&lt;P&gt;I keep getting the following error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jfiacco_0-1629904910028.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/21674i78923F5977D6B4DD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jfiacco_0-1629904910028.png" alt="jfiacco_0-1629904910028.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I've tried various versions of my expression to get rid of the error but nothing seems to be working. Here are examples of what I have tried so far:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;When(($feature.wellLocation == 'A3'), ($feature.A3ArapCycles) &amp;amp;&amp;amp; (TextFormatting.NewLine) &amp;amp;&amp;amp; ($feature.A3ArapFlow), None )&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;When(($feature.wellLocation == 'A3'), ($feature.A3ArapCycles &amp;amp;&amp;amp; TextFormatting.NewLine &amp;amp;&amp;amp; $feature.A3ArapFlow), None )&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;When(($feature.wellLocation == "A3"), ($feature.A3ArapCycles &amp;amp;&amp;amp; TextFormatting.NewLine &amp;amp;&amp;amp; $feature.A3ArapFlow), None )&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;When(($feature.wellLocation == "A3"), ($feature.A3ArapCycles || TextFormatting.NewLine || $feature.A3ArapFlow), None )&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could someone take a look and let me&amp;nbsp;know if anything stands out? I've looked at a lot of documentation but can't seem to figure out why I'm getting this error. I'm relatively new to Arcade so any information/ideas would be greatly appreciated.&lt;/P&gt;&lt;P&gt;Thanks!!&lt;/P&gt;&lt;P&gt;Jenna&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 15:37:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-when-function-execution-error/m-p/1092263#M41882</guid>
      <dc:creator>jfiacco</dc:creator>
      <dc:date>2021-08-25T15:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade When Function Execution Error</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-when-function-execution-error/m-p/1092270#M41883</link>
      <description>&lt;P&gt;To concatenate values, use "+"&lt;/P&gt;&lt;P&gt;&lt;EM&gt;When($feature.wellLocation == 'A3', $feature.A3ArapCycles + TextFormatting.NewLine + $feature.A3ArapFlow, 'None' )&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 16:01:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-when-function-execution-error/m-p/1092270#M41883</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-08-25T16:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade When Function Execution Error</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-when-function-execution-error/m-p/1092276#M41886</link>
      <description>&lt;P&gt;Thanks, Ken.&amp;nbsp;&lt;/P&gt;&lt;P&gt;That removed the error but it's still not recognizing the well location value so nothing is populated in the pop-up.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 16:06:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-when-function-execution-error/m-p/1092276#M41886</guid>
      <dc:creator>jfiacco</dc:creator>
      <dc:date>2021-08-25T16:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade When Function Execution Error</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-when-function-execution-error/m-p/1092299#M41888</link>
      <description>&lt;P&gt;What are the possible values?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 16:44:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-when-function-execution-error/m-p/1092299#M41888</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-08-25T16:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade When Function Execution Error</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-when-function-execution-error/m-p/1092304#M41890</link>
      <description>&lt;P&gt;Here is a screenshot of the some of the attributes. I have over 700 fields. Each field has a prefix, in my form, indicating the specific well location. I only want to show the relevant fields for each well. So, for this well, I only want to show the attributes within the red box. I'm trying to figure out the correct expression/combination of expressions to parse down the attribute list based on the well location. Do you know of a LIKE statement or something similar that might work better than WHEN for this case?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jfiacco_0-1629910109354.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/21682i8E6DCD35029A4344/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jfiacco_0-1629910109354.png" alt="jfiacco_0-1629910109354.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 16:54:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-when-function-execution-error/m-p/1092304#M41890</guid>
      <dc:creator>jfiacco</dc:creator>
      <dc:date>2021-08-25T16:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade When Function Execution Error</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-when-function-execution-error/m-p/1092351#M41891</link>
      <description>&lt;P&gt;You can use this type of syntax to get fields that have multiple prefixes&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var test = "LAST";
return $feature[test + 'EDITOR']&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;This is using one of the profiles in the Arcade playground&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="arcade1.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/21697i93B1D42DB36B9FB5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="arcade1.png" alt="arcade1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 18:00:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-when-function-execution-error/m-p/1092351#M41891</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-08-25T18:00:58Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade When Function Execution Error</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-when-function-execution-error/m-p/1092378#M41892</link>
      <description>&lt;P&gt;What you could do is something like this&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var array = ['ArapCycles', 'ArapFlow'];
var output;
for (var i in array) {
output += $feature[$feature.wellLocation + array[i]] + TextFormatting.NewLine;
}
return output;&lt;/LI-CODE&gt;&lt;P&gt;This is how it works in the Playground&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="arcade1.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/21708i90920B8B3B9554B8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="arcade1.png" alt="arcade1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 18:24:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-when-function-execution-error/m-p/1092378#M41892</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-08-25T18:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade When Function Execution Error</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-when-function-execution-error/m-p/1100006#M42236</link>
      <description>&lt;P&gt;Thanks Ken!&lt;/P&gt;&lt;P&gt;I ended up doing something similar. Instead of creating an array, I created a variable for each field associated with the various well houses and called them that way. It produced an output more along the lines of what I was looking for.&lt;/P&gt;&lt;P&gt;Example:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;var RegencyArapFlow = $feature.RegencyArapFlow&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;var RegencyArapMeter = $feature.RegencyArapMeter&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;var RegencyArapLevel = $feature.RegencyArapLevel&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;var RegencyArapCycles = $feature.RegencyArapCycles&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;var RegencyButterfieldTankLevel = $feature.RegencyButterfieldTankLevel&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;var RegencyBradburyTankLevel = $feature.RegencyBradburyTankLevel&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;var RegencySysPressure = $feature.RegencySysPressure&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;var varRegency;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;if ((!IsEmpty(RegencyArapFlow)) || (!IsEmpty(RegencyArapMeter)) || (!IsEmpty(RegencyArapLevel)) || (!IsEmpty(RegencyArapCycles)) || (!IsEmpty(RegencyButterfieldTankLevel)) || (!IsEmpty(RegencyBradburyTankLevel)) || (!IsEmpty(RegencySysPressure))){&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;varRegency += TextFormatting.NewLine +&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;"Arapahoe Flow: " + RegencyArapFlow + TextFormatting.NewLine +&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;"Arapahoe Totalizer: " + RegencyArapMeter + TextFormatting.NewLine +&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;"Arapahoe Level: " + RegencyArapLevel + TextFormatting.NewLine +&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;"Arapahoe Cycles: " + RegencyArapCycles + TextFormatting.NewLine +&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;"Butterfield Tank Level: " + RegencyButterfieldTankLevel + TextFormatting.NewLine +&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;"Bradbury Tank Level: " + RegencyBradburyTankLevel + TextFormatting.NewLine +&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;"System Pressure: " + RegencySysPressure + TextFormatting.NewLine &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;return varRegency&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for your help!&lt;/P&gt;</description>
      <pubDate>Mon, 20 Sep 2021 17:23:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-when-function-execution-error/m-p/1100006#M42236</guid>
      <dc:creator>jfiacco</dc:creator>
      <dc:date>2021-09-20T17:23:42Z</dc:date>
    </item>
  </channel>
</rss>

