<?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: Add Related table attributes onto polygon's pop-up in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/add-related-table-attributes-onto-polygon-s-pop-up/m-p/1275242#M51268</link>
    <description>&lt;P&gt;This expression will show each of the surveys' url&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var related = FeatureSetByRelationshipName($feature, "DCGIS.SURDOCS");
var output = `${count(related)} survey`;
if (count(related) != 1) output += "s";
for (var rec in related) {
  output += `${TextFormatting.NewLine}• ${rec.FILENETLINK}`
}
return output;&lt;/LI-CODE&gt;&lt;P&gt;. However, I don't think there's currently a way to make each of them clickable&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="popup2.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/67191i09EF44FB42936417/image-size/medium?v=v2&amp;amp;px=400" role="button" title="popup2.png" alt="popup2.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Apr 2023 13:31:59 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2023-04-04T13:31:59Z</dc:date>
    <item>
      <title>Add Related table attributes onto polygon's pop-up</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/add-related-table-attributes-onto-polygon-s-pop-up/m-p/1274352#M51202</link>
      <description>&lt;P&gt;Hello!&amp;nbsp; I need assistance with adding related table fields to a polygons popup.&amp;nbsp; The source data is below.&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/350340"&gt;@JohanLei1&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;polygon:&amp;nbsp;&lt;A href="https://maps2.dcgis.dc.gov/dcgis/rest/services/DCGIS_DATA/Property_and_Land_WebMercator/MapServer/40" target="_blank"&gt;https://maps2.dcgis.dc.gov/dcgis/rest/services/DCGIS_DATA/Property_and_Land_WebMercator/MapServer/40&lt;/A&gt;&lt;/P&gt;&lt;P&gt;related table:&amp;nbsp;&lt;A href="https://maps2.dcgis.dc.gov/dcgis/rest/services/DCGIS_DATA/Property_and_Land_WebMercator/MapServer/69" target="_blank"&gt;https://maps2.dcgis.dc.gov/dcgis/rest/services/DCGIS_DATA/Property_and_Land_WebMercator/MapServer/69&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Apr 2023 04:13:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/add-related-table-attributes-onto-polygon-s-pop-up/m-p/1274352#M51202</guid>
      <dc:creator>LearnThenShare_JC</dc:creator>
      <dc:date>2023-04-01T04:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: Add Related table attributes onto polygon's pop-up</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/add-related-table-attributes-onto-polygon-s-pop-up/m-p/1274670#M51225</link>
      <description>&lt;P&gt;This expression will show how many surveys from the table have been done at a property.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var related = FeatureSetByRelationshipName($feature, "DCGIS.SURDOCS");
var output = `${count(related)} survey`;
if (count(related) != 1) output += "s";
return output;&lt;/LI-CODE&gt;&lt;P&gt;You can use that expression in the popup like this&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="related.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/67068i92159014C2546C56/image-size/medium?v=v2&amp;amp;px=400" role="button" title="related.png" alt="related.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2023 14:02:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/add-related-table-attributes-onto-polygon-s-pop-up/m-p/1274670#M51225</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2023-04-03T14:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: Add Related table attributes onto polygon's pop-up</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/add-related-table-attributes-onto-polygon-s-pop-up/m-p/1274991#M51251</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt;&amp;nbsp;, Thank you for the expression.&amp;nbsp; If I am looking to add the one or more attributes from the related table, not simply a count, is there an additional Arcade expression that makes that happen?&amp;nbsp; The related table has an image type field and an image URL.&amp;nbsp; I would like the image type attribute(s) and the image URL(s) to show in the popup - not only accessible in the "related tables" link at the bottom.&amp;nbsp; Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2023 21:16:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/add-related-table-attributes-onto-polygon-s-pop-up/m-p/1274991#M51251</guid>
      <dc:creator>LearnThenShare_JC</dc:creator>
      <dc:date>2023-04-03T21:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: Add Related table attributes onto polygon's pop-up</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/add-related-table-attributes-onto-polygon-s-pop-up/m-p/1275242#M51268</link>
      <description>&lt;P&gt;This expression will show each of the surveys' url&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var related = FeatureSetByRelationshipName($feature, "DCGIS.SURDOCS");
var output = `${count(related)} survey`;
if (count(related) != 1) output += "s";
for (var rec in related) {
  output += `${TextFormatting.NewLine}• ${rec.FILENETLINK}`
}
return output;&lt;/LI-CODE&gt;&lt;P&gt;. However, I don't think there's currently a way to make each of them clickable&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="popup2.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/67191i09EF44FB42936417/image-size/medium?v=v2&amp;amp;px=400" role="button" title="popup2.png" alt="popup2.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2023 13:31:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/add-related-table-attributes-onto-polygon-s-pop-up/m-p/1275242#M51268</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2023-04-04T13:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: Add Related table attributes onto polygon's pop-up</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/add-related-table-attributes-onto-polygon-s-pop-up/m-p/1275815#M51309</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt;&amp;nbsp;: Thank you again for the additional expression!&amp;nbsp; This is very promising.&amp;nbsp; I do wonder what are the technical limitations specific to bringing in the full data from related tables.&amp;nbsp; I will implement the expression that you provided and let you know when it works (and accept as solution), and I will let you know if I find out how to make all the link data actual links to the image.&amp;nbsp; Thank you!!!&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2023 15:02:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/add-related-table-attributes-onto-polygon-s-pop-up/m-p/1275815#M51309</guid>
      <dc:creator>LearnThenShare_JC</dc:creator>
      <dc:date>2023-04-05T15:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: Add Related table attributes onto polygon's pop-up</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/add-related-table-attributes-onto-polygon-s-pop-up/m-p/1275845#M51310</link>
      <description>&lt;P&gt;All the attributes from each related record are available to the popup, as shown in this script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var counter = 1;
var related = FeatureSetByRelationshipName($feature, "DCGIS.SURDOCS");
var relatedCount = count(related);
var output;

for (var rec in related) {
  output += `Record ${counter++}`
  for (var attribute in rec){
    output += `${TextFormatting.NewLine}•  ${attribute}: ${rec[attribute]}`   
  }
  if (counter &amp;lt;= relatedCount) output += `${TextFormatting.NewLine}${TextFormatting.NewLine}`
}
return output;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2023 16:05:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/add-related-table-attributes-onto-polygon-s-pop-up/m-p/1275845#M51310</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2023-04-05T16:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: Add Related table attributes onto polygon's pop-up</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/add-related-table-attributes-onto-polygon-s-pop-up/m-p/1276516#M51341</link>
      <description>&lt;P&gt;With some more work, I was able to get a clickable link for each related survey. This is using the &lt;A href="https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/part-1-introducing-arcade-pop-up-content-elements/" target="_self"&gt;popup content element&lt;/A&gt;. Add in an Arcade element and use this script&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var related = FeatureSetByRelationshipName($feature, "DCGIS.SURDOCS");
var relatedCount = count(related);
var output;

if (relatedCount == 0) {
  output = `&amp;lt;p&amp;gt;There are no surveys for this property.&amp;lt;\p&amp;gt;`;
} else if (relatedCount == 1) {
  var rec = First(related);
  output = `There is 1 survey for this property:
    &amp;lt;br&amp;gt;&amp;amp;nbsp •  &amp;lt;a href="${rec.FILENETLINK}"&amp;gt;${rec.DOCGUID}&amp;lt;/a&amp;gt;`;
} else {
  output = `There are ${relatedCount} surveys for this property:`;
  for (var rec in related) {
    output += `&amp;lt;br&amp;gt;&amp;amp;nbsp •  &amp;lt;a href="${rec.FILENETLINK}"&amp;gt;${rec.DOCGUID}&amp;lt;/a&amp;gt;`;
  }
}

return { 
	type : 'text', 
	text : output
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="survey1.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/67478i9F037BB7ADA23111/image-size/medium?v=v2&amp;amp;px=400" role="button" title="survey1.png" alt="survey1.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2023 13:27:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/add-related-table-attributes-onto-polygon-s-pop-up/m-p/1276516#M51341</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2023-04-07T13:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: Add Related table attributes onto polygon's pop-up</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/add-related-table-attributes-onto-polygon-s-pop-up/m-p/1326928#M54470</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you assist again with a similar expression?&amp;nbsp; FYI I am still on Classic Map if that matters here.&lt;/P&gt;&lt;P&gt;The polygon:&amp;nbsp;&lt;A href="https://maps2.dcgis.dc.gov/dcgis/rest/services/DCGIS_DATA/Property_and_Land_WebMercator/MapServer/40" target="_blank" rel="noopener"&gt;https://maps2.dcgis.dc.gov/dcgis/rest/services/DCGIS_DATA/Property_and_Land_WebMercator/MapServer/40&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The related table:&amp;nbsp;&lt;A href="https://maps2.dcgis.dc.gov/dcgis/rest/services/DCGIS_DATA/Property_and_Land_WebMercator/MapServer/53" target="_blank" rel="noopener"&gt;https://maps2.dcgis.dc.gov/dcgis/rest/services/DCGIS_DATA/Property_and_Land_WebMercator/MapServer/53&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The fields from the related table for the popup:&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;BIDNAME&lt;I&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;( type: esriFieldTypeString, alias: BIDNAME, length: 50 )&lt;/I&gt;&lt;/LI&gt;&lt;LI&gt;BIDTOTALDUE&lt;I&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;( type: esriFieldTypeDouble, alias: BIDTOTALDUE )&lt;/I&gt;&lt;/LI&gt;&lt;LI&gt;BIDCOLLECTED&lt;I&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;( type: esriFieldTypeDouble, alias: BIDCOLLECTED )&lt;/I&gt;&lt;/LI&gt;&lt;LI&gt;BIDBALANCE&lt;I&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;( type: esriFieldTypeDouble, alias: BIDBALANCE )&lt;/I&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;I&gt;Thank you!&lt;/I&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 18:30:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/add-related-table-attributes-onto-polygon-s-pop-up/m-p/1326928#M54470</guid>
      <dc:creator>LearnThenShare_JC</dc:creator>
      <dc:date>2023-09-08T18:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: Add Related table attributes onto polygon's pop-up</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/add-related-table-attributes-onto-polygon-s-pop-up/m-p/1326980#M54473</link>
      <description>&lt;P&gt;Give this a try:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var rec = First(FeatureSetByRelationshipName($feature, "DCGIS.ITSPE", ['BIDNAME', 'BIDTOTALDUE', 'BIDCOLLECTED', 'BIDBALANCE']));

return `${rec.BIDNAME}
    • Total Due: ${Text(rec.BIDTOTALDUE, '$#,###.00')}
    • Collected: ${Text(rec.BIDCOLLECTED, '$#,###.00')}
    • Balance: ${Text(rec.BIDBALANCE, '$#,###.00')}`&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 08 Sep 2023 19:47:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/add-related-table-attributes-onto-polygon-s-pop-up/m-p/1326980#M54473</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2023-09-08T19:47:15Z</dc:date>
    </item>
  </channel>
</rss>

