<?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 correct but doesn't show up in popup in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-correct-but-doesn-t-show-up-in/m-p/1240112#M49295</link>
    <description>&lt;P&gt;Thanks for pointing me to the right direction Johannes. I tried my code in an expression and as an element, for some reason it was not working in an expression, now it does. And your code works with the element.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a great day too &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Dec 2022 13:32:40 GMT</pubDate>
    <dc:creator>Geraldine</dc:creator>
    <dc:date>2022-12-12T13:32:40Z</dc:date>
    <item>
      <title>Arcade expression correct but doesn't show up in popup</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-correct-but-doesn-t-show-up-in/m-p/1240075#M49289</link>
      <description>&lt;P&gt;I've written an Arcade expression for a layer's popup in the new map viewer, based on records from a related table. The expression returns the expected text, but the layer's popup is empty.&lt;/P&gt;&lt;P&gt;Adding a new Arcade expression with the&amp;nbsp; default code works:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;EM&gt;return { &lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;EM&gt;&amp;nbsp; type : 'text', &lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;EM&gt;&amp;nbsp; text : 'place your text or html here' //this property supports html tags &lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The layer and the related table both have popups enabled and all fields are visible. So what am I doing wrong?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;This is the code:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;&lt;FONT size="2"&gt;var dossiers = FeatureSetById($datastore, "4")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;// Filter related features by using a common attribute&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;var CD = $feature.Code&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;var filterStatement = "domeinnummer = &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/352010"&gt;@CD&lt;/a&gt;"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;// Related features as a variable&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;var relatedData = Filter(dossiers, filterStatement)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;// Sort related features by oldest to newest&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;var relatedDataSorted = OrderBy(relatedData, 'Dossiernummer ASC')&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;// Build the pop-up string by iterating through all related features&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;var popupString = "Domein " + $feature.Domein&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;for (var f in relatedDataSorted){&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;popupString += TextFormatting.NewLine + DefaultValue(Text(f.Dossiernummer), 'geen nr') + " - " + DefaultValue(f.Naam_OVAM_Dossier, 'geen naam') &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;+ TextFormatting.NewLine + " " + DefaultValue(f.Expert_Status, 'geen status')&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;DefaultValue(popupString, 'Geen dossier')&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 12 Dec 2022 12:25:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-correct-but-doesn-t-show-up-in/m-p/1240075#M49289</guid>
      <dc:creator>Geraldine</dc:creator>
      <dc:date>2022-12-12T12:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression correct but doesn't show up in popup</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-correct-but-doesn-t-show-up-in/m-p/1240086#M49290</link>
      <description>&lt;P&gt;It would help if post your actual code...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_0-1670847280076.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/58264i04C8C27178D3E331/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_0-1670847280076.png" alt="JohannesLindner_0-1670847280076.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;JohannesLindner_0-1670847280076.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_1-1670847292079.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/58265iD8F79DAAC1980830/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_1-1670847292079.png" alt="JohannesLindner_1-1670847292079.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;JohannesLindner_1-1670847292079.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2022 12:15:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-correct-but-doesn-t-show-up-in/m-p/1240086#M49290</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-12-12T12:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression correct but doesn't show up in popup</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-correct-but-doesn-t-show-up-in/m-p/1240089#M49291</link>
      <description>&lt;P&gt;Hi Johannes, I've added it to the question, but since it works, I don't see how seeing the code would help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Based on&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-online-blog/show-related-data-or-tables-in-pop-ups-with-arcade/ba-p/890530" target="_self"&gt;this example&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2022 12:26:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-correct-but-doesn-t-show-up-in/m-p/1240089#M49291</guid>
      <dc:creator>Geraldine</dc:creator>
      <dc:date>2022-12-12T12:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression correct but doesn't show up in popup</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-correct-but-doesn-t-show-up-in/m-p/1240103#M49293</link>
      <description>&lt;P&gt;It helps tremendously, because now I can see what you're doing wrong.&lt;/P&gt;&lt;P&gt;Based on the working default code, you're trying to add an Arcade element. For that to work, you need to return a dictionary (&lt;A href="https://developers.arcgis.com/arcade/profiles/popup-element/" target="_blank" rel="noopener"&gt;documentation&lt;/A&gt;). In your actual expression, you're not doing that, instead you return a string.&lt;/P&gt;&lt;P&gt;There is a difference between a "normal" Arcade expression (#1 in the images) and an Arcade element (#2). The value of a "normal" Arcade expression can be shown in the fields list. The Arcade element is more customizable, and, as said, you need to return a dictionary.&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_1-1670850745743.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/58272iDAB232C1548777FA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_1-1670850745743.png" alt="JohannesLindner_1-1670850745743.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;JohannesLindner_1-1670850745743.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohannesLindner_2-1670850803088.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/58273iADE7ED2977A868E1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_2-1670850803088.png" alt="JohannesLindner_2-1670850803088.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;JohannesLindner_2-1670850803088.png&lt;/span&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;Replace your last line with this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;return {
    type: 'text',
    text: DefaultValue(popupString, 'Geen dossier')
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2022 13:14:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-correct-but-doesn-t-show-up-in/m-p/1240103#M49293</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-12-12T13:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression correct but doesn't show up in popup</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-correct-but-doesn-t-show-up-in/m-p/1240112#M49295</link>
      <description>&lt;P&gt;Thanks for pointing me to the right direction Johannes. I tried my code in an expression and as an element, for some reason it was not working in an expression, now it does. And your code works with the element.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a great day too &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2022 13:32:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-correct-but-doesn-t-show-up-in/m-p/1240112#M49295</guid>
      <dc:creator>Geraldine</dc:creator>
      <dc:date>2022-12-12T13:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression correct but doesn't show up in popup</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-correct-but-doesn-t-show-up-in/m-p/1565921#M62751</link>
      <description>&lt;P&gt;This helped me too!&amp;nbsp; Thanks Johannes! &lt;span class="lia-unicode-emoji" title=":raising_hands:"&gt;🙌&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Dec 2024 01:58:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expression-correct-but-doesn-t-show-up-in/m-p/1565921#M62751</guid>
      <dc:creator>JDScharf</dc:creator>
      <dc:date>2024-12-07T01:58:47Z</dc:date>
    </item>
  </channel>
</rss>

