<?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: Related data in AGOL popups in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/related-data-in-agol-popups/m-p/1111469#M42759</link>
    <description>&lt;P&gt;Ha! No, it wasn't!&amp;nbsp; That was easy-- thank you so much!&lt;/P&gt;</description>
    <pubDate>Tue, 26 Oct 2021 22:06:48 GMT</pubDate>
    <dc:creator>Hatsocks</dc:creator>
    <dc:date>2021-10-26T22:06:48Z</dc:date>
    <item>
      <title>Related data in AGOL popups</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/related-data-in-agol-popups/m-p/1111440#M42756</link>
      <description>&lt;P&gt;Hello all-&lt;/P&gt;&lt;P&gt;I am trying to create a popup in the new AGOL Map Viewer that includes related inspection data for water valves.&amp;nbsp; Each valve has three inspection records related to it.&amp;nbsp; With the help of this blog post (&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="_blank"&gt;https://community.esri.com/t5/arcgis-online-blog/show-related-data-or-tables-in-pop-ups-with-arcade/ba-p/890530&lt;/A&gt; I created this Arcade expression:&lt;/P&gt;&lt;P&gt;//access related data&lt;BR /&gt;var Inspections = (FeatureSetByName($datastore,"AM_Demo_Valve_Turning_Results2_2021"))&lt;/P&gt;&lt;P&gt;//filter related features by using a common attribute&lt;BR /&gt;var Valve_ID = $feature.Valve_ID&lt;BR /&gt;var filterStatement = 'Valve_ID = @Valve_ID'&lt;/P&gt;&lt;P&gt;//related features as a variable&lt;BR /&gt;var relatedData = Filter(Inspections, filterStatement)&lt;/P&gt;&lt;P&gt;//build popup string by iterating through all related features&lt;BR /&gt;var popupString = ''&lt;BR /&gt;for (var f in relatedData){&lt;BR /&gt;popupString += Text(f.Valve_ID) + TextFormatting.NewLine +&lt;BR /&gt;&lt;BR /&gt;"Inspection Date: " +&lt;BR /&gt;(f.Inspection_Date) + TextFormatting.NewLine +&lt;BR /&gt;&lt;BR /&gt;"Issues Observed: " +&lt;BR /&gt;(f.Issues_Observed) + TextFormatting.NewLine +&lt;BR /&gt;&lt;BR /&gt;"Repairs Needed: " +&lt;BR /&gt;(f.Repairs_Needed) + TextFormatting.NewLine +&lt;BR /&gt;&lt;BR /&gt;"Repairs Made: " +&lt;BR /&gt;(f.Repairs_Made) + TextFormatting.NewLine +&lt;BR /&gt;&lt;BR /&gt;"Repaired Date: " +&lt;BR /&gt;(f.Repaired_Date) + TextFormatting.NewLine +&lt;BR /&gt;&lt;BR /&gt;"Next Inspection Date: " +&lt;BR /&gt;(f.Next_Inspection_Date) + TextFormatting.NewLine +&lt;BR /&gt;&lt;BR /&gt;TextFormatting.NewLine&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;return popupString&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I test the arcade expression, it looks just like what I want in the popup:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JosephineHatton_0-1635278516959.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/26248i7AB53F9F32B32E16/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JosephineHatton_0-1635278516959.png" alt="JosephineHatton_0-1635278516959.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;...but the popup looks like this, showing just one inspection record after the valve data, and including inspection fields that the Arcade expression doesn't specify:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JosephineHatton_1-1635278644073.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/26250iB0863007A05D98FD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JosephineHatton_1-1635278644073.png" alt="JosephineHatton_1-1635278644073.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I'm pretty clumsy with Arcade so I'm hoping it's a simple mistake... any help is much appreciated!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 20:22:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/related-data-in-agol-popups/m-p/1111440#M42756</guid>
      <dc:creator>Hatsocks</dc:creator>
      <dc:date>2021-10-26T20:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: Related data in AGOL popups</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/related-data-in-agol-popups/m-p/1111442#M42757</link>
      <description>&lt;P&gt;code looks good, are you sure your "expression"&amp;nbsp; is listed in your list of pop-ups fields?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 21:01:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/related-data-in-agol-popups/m-p/1111442#M42757</guid>
      <dc:creator>DominicRobergeIADOT</dc:creator>
      <dc:date>2021-10-26T21:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: Related data in AGOL popups</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/related-data-in-agol-popups/m-p/1111469#M42759</link>
      <description>&lt;P&gt;Ha! No, it wasn't!&amp;nbsp; That was easy-- thank you so much!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 22:06:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/related-data-in-agol-popups/m-p/1111469#M42759</guid>
      <dc:creator>Hatsocks</dc:creator>
      <dc:date>2021-10-26T22:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: Related data in AGOL popups</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/related-data-in-agol-popups/m-p/1111706#M42764</link>
      <description>&lt;P&gt;those little things &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;FYI, if you try to use that expression in Fields Maps... it won't work..I have been working with ESRI Tech Support on that and this morning they logged it as a bug (I was using almost the same code to bring attachments in the popup)&lt;/P&gt;&lt;P&gt;Reference number:-&amp;nbsp;BUG-000144024&lt;BR /&gt;Public Status:- New&lt;BR /&gt;Synopsis:-&amp;nbsp;The arcade expression to count the number of attachments fails to honor in the ArcGIS Field Maps.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 16:25:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/related-data-in-agol-popups/m-p/1111706#M42764</guid>
      <dc:creator>DominicRobergeIADOT</dc:creator>
      <dc:date>2021-10-27T16:25:19Z</dc:date>
    </item>
  </channel>
</rss>

