<?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 Arcade expression for multi step replacement of codes from Survey123, in a list in Dashboards. in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-for-multi-step-replacement-of/m-p/1497413#M9861</link>
    <description>&lt;P&gt;Hi Community folks,&lt;/P&gt;&lt;P&gt;I have an interesting problem.&amp;nbsp; I am new to Arcade, so this may be a simple fix.&amp;nbsp; I have a Survey123 feature service that has several attributes that have multiple entries.&amp;nbsp; I am working on a Dashboard to report out these results.&amp;nbsp; For example, one field has entries of CG, JR, TB, WB, and can include anywhere from one to all of them, separated by commas.&amp;nbsp; I want the Dashboard to report out the sentence of what they mean.&amp;nbsp; CG = Co-Governance, JR = Just Responsibility, TB = Targeted Benefits, and WB = Wealth Building.&amp;nbsp; Then list them with a &amp;lt;br&amp;gt; under a heading. I have used REPLACE to get the list effect with other entries&lt;/P&gt;&lt;P&gt;I have tried IIF, WHEN and DECODE, but these seem to just list the first true statement and only one instance of it (if it is the sole entry), and then ignore the rest.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated!&amp;nbsp; Thanks!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LindaKoch2_1-1719358284717.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/107940iB2819982FC2A829E/image-size/large?v=v2&amp;amp;px=999" role="button" title="LindaKoch2_1-1719358284717.png" alt="LindaKoch2_1-1719358284717.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Results: (the CG, TB etc in the heading are what should show)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LindaKoch2_2-1719358454599.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/107941i45BE02FA0DEF85AA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LindaKoch2_2-1719358454599.png" alt="LindaKoch2_2-1719358454599.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LindaKoch2_3-1719358508311.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/107942i77D52AA48C9706AD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LindaKoch2_3-1719358508311.png" alt="LindaKoch2_3-1719358508311.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Jun 2024 23:39:23 GMT</pubDate>
    <dc:creator>LindaKoch2</dc:creator>
    <dc:date>2024-06-25T23:39:23Z</dc:date>
    <item>
      <title>Arcade expression for multi step replacement of codes from Survey123, in a list in Dashboards.</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-for-multi-step-replacement-of/m-p/1497413#M9861</link>
      <description>&lt;P&gt;Hi Community folks,&lt;/P&gt;&lt;P&gt;I have an interesting problem.&amp;nbsp; I am new to Arcade, so this may be a simple fix.&amp;nbsp; I have a Survey123 feature service that has several attributes that have multiple entries.&amp;nbsp; I am working on a Dashboard to report out these results.&amp;nbsp; For example, one field has entries of CG, JR, TB, WB, and can include anywhere from one to all of them, separated by commas.&amp;nbsp; I want the Dashboard to report out the sentence of what they mean.&amp;nbsp; CG = Co-Governance, JR = Just Responsibility, TB = Targeted Benefits, and WB = Wealth Building.&amp;nbsp; Then list them with a &amp;lt;br&amp;gt; under a heading. I have used REPLACE to get the list effect with other entries&lt;/P&gt;&lt;P&gt;I have tried IIF, WHEN and DECODE, but these seem to just list the first true statement and only one instance of it (if it is the sole entry), and then ignore the rest.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated!&amp;nbsp; Thanks!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LindaKoch2_1-1719358284717.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/107940iB2819982FC2A829E/image-size/large?v=v2&amp;amp;px=999" role="button" title="LindaKoch2_1-1719358284717.png" alt="LindaKoch2_1-1719358284717.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Results: (the CG, TB etc in the heading are what should show)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LindaKoch2_2-1719358454599.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/107941i45BE02FA0DEF85AA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LindaKoch2_2-1719358454599.png" alt="LindaKoch2_2-1719358454599.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LindaKoch2_3-1719358508311.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/107942i77D52AA48C9706AD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LindaKoch2_3-1719358508311.png" alt="LindaKoch2_3-1719358508311.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2024 23:39:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-for-multi-step-replacement-of/m-p/1497413#M9861</guid>
      <dc:creator>LindaKoch2</dc:creator>
      <dc:date>2024-06-25T23:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression for multi step replacement of codes from Survey123, in a list in Dashboards.</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-for-multi-step-replacement-of/m-p/1497439#M9862</link>
      <description>&lt;P&gt;You're &lt;EM&gt;very &lt;/EM&gt;close. First, split the field into an array based on those commas. Then you can apply Decode to everything in the array.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// split into an array
var ej_arr = Split($datapoint['ej_new'], ',')

// custom function to decode array items
function EJDecode(x) {
  return Decode(
    x,
    'CG', 'CO-GOVERNANCE…',
    'TG', 'TARGETED BENEFITS…',
    'WB', 'WEALTH-BUILDING…',
    'JR', 'JUST RESPONSIBILITY…',
    ''
  )
}

// apply EJDecode to array
ej_arr = Map(ej_arr, EJDecode)

// join array items together with line breaks
var spaced_ej = Concatenate(ej_arr, '&amp;lt;br&amp;gt;')&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 26 Jun 2024 02:26:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-for-multi-step-replacement-of/m-p/1497439#M9862</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2024-06-26T02:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression for multi step replacement of codes from Survey123, in a list in Dashboards.</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-for-multi-step-replacement-of/m-p/1497669#M9867</link>
      <description>&lt;P&gt;Thank you so much Josh, for taking the time to look at this.&amp;nbsp; I'm glad I was on the right track.&amp;nbsp; Your code helped me understand the step.&amp;nbsp; It still didn't quite work right, but instead of ',' it needed to be ', ' with the extra space after the comma.&amp;nbsp; Works great now!&amp;nbsp; Thanks again for your expert help!&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2024 15:33:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-expression-for-multi-step-replacement-of/m-p/1497669#M9867</guid>
      <dc:creator>LindaKoch2</dc:creator>
      <dc:date>2024-06-26T15:33:58Z</dc:date>
    </item>
  </channel>
</rss>

