<?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 expression to decode values in ArcGIS Online Developers Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-to-decode-values/m-p/329545#M394</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What are the values that are possible for &lt;EM&gt;dn&lt;/EM&gt;? Can you share that service or provide a list of some of the values?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Jul 2018 16:01:34 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2018-07-17T16:01:34Z</dc:date>
    <item>
      <title>Arcade expression to decode values</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-to-decode-values/m-p/329544#M393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to use an Arcade expression to display coded values in a popup in ArcGIS Online, but it is not working.&amp;nbsp;I am using the code from&amp;nbsp;the&amp;nbsp;&lt;A href="https://developers.arcgis.com/arcade/function-reference/logical_functions/"&gt;decode example&lt;/A&gt;. It does not display in the popup. No error message is given in the popup.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var code = $feature.dn;&lt;BR /&gt;var decodedValue = Decode(code, 2, 'Non-Severe', 3, 'Marginal', 4, 'Slight', 'Other');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not the author of the map service. The dn field is an&amp;nbsp;&lt;EM style="color: #000000; background-color: #ffffff; font-size: 14.4px;"&gt;esriFieldTypeDouble. &lt;/EM&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="color: #000000; background-color: #ffffff; font-size: 14.4px;"&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/414334_2018-07-17_10-42-57.png" /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jul 2018 15:45:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-to-decode-values/m-p/329544#M393</guid>
      <dc:creator>AndrewL</dc:creator>
      <dc:date>2018-07-17T15:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression to decode values</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-to-decode-values/m-p/329545#M394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What are the values that are possible for &lt;EM&gt;dn&lt;/EM&gt;? Can you share that service or provide a list of some of the values?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jul 2018 16:01:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-to-decode-values/m-p/329545#M394</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2018-07-17T16:01:34Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression to decode values</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-to-decode-values/m-p/329546#M395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sure it is a public service from NWS:&amp;nbsp;&lt;A class="link-titled" href="https://idpgis.ncep.noaa.gov/arcgis/rest/services/NWS_Forecasts_Guidance_Warnings/SPC_wx_outlks/MapServer/1" title="https://idpgis.ncep.noaa.gov/arcgis/rest/services/NWS_Forecasts_Guidance_Warnings/SPC_wx_outlks/MapServer/1"&gt;Layer: Day 1 Convective Outlook (ID: 1)&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Possible values are 2, 3, 4, 5, 6, and 7.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jul 2018 16:05:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-to-decode-values/m-p/329546#M395</guid>
      <dc:creator>AndrewL</dc:creator>
      <dc:date>2018-07-17T16:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression to decode values</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-to-decode-values/m-p/329547#M396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You needed to state what value to return. See the &lt;A href="https://developers.arcgis.com/arcade/guide/#returning-values-from-your-script" rel="nofollow noopener noreferrer" target="_blank"&gt;documentation&lt;/A&gt; about this.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; code &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; $feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;dn&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; decodedValue &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Decode&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;code&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Non-Severe'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Marginal'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Slight'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Other'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
decodedValue&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍&amp;nbsp; &lt;SPAN class="comment token"&gt;//return decodedValue; also works‍‍‍&lt;/SPAN&gt;&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or it could be a single line expression.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="token function"&gt;Decode&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;$feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;dn&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Non-Severe'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Marginal'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Slight'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Other'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍
&lt;SPAN class="comment token"&gt;// return Decode($feature.dn, 2, 'Non-Severe', 3, 'Marginal', 4, 'Slight', 'Other');‍‍‍‍ to be more explicit&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&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>Sat, 11 Dec 2021 15:36:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-to-decode-values/m-p/329547#M396</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-12-11T15:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression to decode values</title>
      <link>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-to-decode-values/m-p/329548#M397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great! Thanks, that worked.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jul 2018 17:39:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-developers-questions/arcade-expression-to-decode-values/m-p/329548#M397</guid>
      <dc:creator>AndrewL</dc:creator>
      <dc:date>2018-07-17T17:39:18Z</dc:date>
    </item>
  </channel>
</rss>

