<?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: How to get attribute with last date modified from related table using Arcade in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293203#M14635</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/people/kmsmikrud"&gt;kmsmikrud&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am glad that the expression is doing what you wanted to achieve. At this point I am not sure if the expression will work in Collector. Support for Arcade is incrementing with each release, but the best you can do is try it out and when you do, please post back your findings.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Jun 2020 18:55:13 GMT</pubDate>
    <dc:creator>XanderBakker</dc:creator>
    <dc:date>2020-06-04T18:55:13Z</dc:date>
    <item>
      <title>How to get attribute with last date modified from related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293183#M14615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Hello all,&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;I'm&amp;nbsp;pretty new to Arcade and I'm having problems.&amp;nbsp; I believe I need to be using FeatureSets in Arcade.&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;I have a hosted feature layer with several related tables, some of which are 1:M.&amp;nbsp; In the CIP_Test pop-up, for the 1:M related tables, I only need to show the data from the rows with the latest "Date Modified".&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;I've attached a screenshot of the related table.&amp;nbsp; Where there are duplicate AcctNo, I only&amp;nbsp;want to show the ProjectPhase (and maybe other fields) for the record that was last modified.&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Any suggestions on how to do this are much appreciated!&amp;nbsp; I have gotten nothing but errors in everything I've tried from any forum posts I've found....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Nov 2019 22:38:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293183#M14615</guid>
      <dc:creator>KellyDoss1</dc:creator>
      <dc:date>2019-11-06T22:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to get attribute with last date modified from related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293184#M14616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3100" target="_blank"&gt;Xander Bakker&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;I had posted this same question at the bottom of the "Overlapping Features in Pop-Ups.....FeatureSets with Arcade" blog post and you responded with:&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P style="line-height: 15.0pt;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica',sans-serif; color: #666666;"&gt;Hi&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="line-height: 15.0pt; min-height: 8pt;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica',sans-serif; color: #666666;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="line-height: 15.0pt;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica',sans-serif; color: #666666;"&gt;You could probably try something like shown below. Keep in mind that you need to change some field names to match your data. The idea is to get the ID from the current feature and create a filter to get the related project phases. This is sorted descending on the date and you get the first element from the result, which should be the most recent change in project phase.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #666666; "&gt;var&lt;/SPAN&gt;&lt;CODE&gt;&lt;SPAN style="color: #666666;"&gt; yourid &lt;/SPAN&gt;&lt;/CODE&gt;&lt;SPAN style="color: #666666; "&gt;=&lt;/SPAN&gt;&lt;CODE&gt;&lt;SPAN style="color: #666666;"&gt; $feature&lt;/SPAN&gt;&lt;/CODE&gt;&lt;SPAN style="color: #666666; "&gt;.&lt;/SPAN&gt;&lt;CODE&gt;&lt;SPAN style="color: #666666;"&gt;YourIdField&lt;/SPAN&gt;&lt;/CODE&gt;&lt;SPAN style="color: #666666; "&gt;;&lt;/SPAN&gt;&lt;CODE&gt;&lt;SPAN style="color: #666666;"&gt; &lt;/SPAN&gt;&lt;/CODE&gt;&lt;SPAN style="color: #666666; "&gt;// change the name of the field&lt;/SPAN&gt;&lt;SPAN style="color: #666666;"&gt;
&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;CODE&gt; tblphases &lt;/CODE&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;CODE&gt; &lt;/CODE&gt;&lt;SPAN&gt;FeatureSetByName&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;CODE&gt;$map&lt;/CODE&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;CODE&gt; &lt;/CODE&gt;&lt;SPAN&gt;"CIP Test - Project Phase"&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;
&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;CODE&gt; sql &lt;/CODE&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;CODE&gt; &lt;/CODE&gt;&lt;SPAN&gt;"YourIdField = '"&lt;/SPAN&gt;&lt;CODE&gt; &lt;/CODE&gt;&lt;SPAN&gt;+&lt;/SPAN&gt;&lt;CODE&gt; yourid &lt;/CODE&gt;&lt;SPAN&gt;+&lt;/SPAN&gt;&lt;CODE&gt; &lt;/CODE&gt;&lt;SPAN&gt;"'"&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;CODE&gt; &lt;/CODE&gt;&lt;SPAN&gt;// if field is text&lt;/SPAN&gt;
&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;CODE&gt; relphases &lt;/CODE&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;CODE&gt; &lt;/CODE&gt;&lt;SPAN&gt;Filter&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;CODE&gt;tblphases&lt;/CODE&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;CODE&gt; sql&lt;/CODE&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;
&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;CODE&gt; cnt &lt;/CODE&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;CODE&gt; &lt;/CODE&gt;&lt;SPAN&gt;Count&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;CODE&gt;relphases&lt;/CODE&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;
&lt;SPAN&gt;Console&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;CODE&gt;cnt&lt;/CODE&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;

&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;CODE&gt; result &lt;/CODE&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;CODE&gt; &lt;/CODE&gt;&lt;SPAN&gt;""&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;
&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;CODE&gt; &lt;/CODE&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;CODE&gt;cnt &lt;/CODE&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;CODE&gt; &lt;/CODE&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;CODE&gt; &lt;/CODE&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;
&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; result &lt;/CODE&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;CODE&gt; &lt;/CODE&gt;&lt;SPAN&gt;"Project phase:"&lt;/SPAN&gt;&lt;CODE&gt; &lt;/CODE&gt;&lt;SPAN&gt;+&lt;/SPAN&gt;&lt;CODE&gt; TextFormatting&lt;/CODE&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;CODE&gt;NewLine&lt;/CODE&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;
&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/CODE&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;CODE&gt; currentphase &lt;/CODE&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;CODE&gt; &lt;/CODE&gt;&lt;SPAN&gt;First&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;OrderBy&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;CODE&gt;relphases&lt;/CODE&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;CODE&gt; &lt;/CODE&gt;&lt;SPAN&gt;'DateModified DESC'&lt;/SPAN&gt;&lt;SPAN&gt;));&lt;/SPAN&gt;
&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; result &lt;/CODE&gt;&lt;SPAN&gt;+=&lt;/SPAN&gt;&lt;CODE&gt; &lt;/CODE&gt;&lt;SPAN&gt;"Date : "&lt;/SPAN&gt;&lt;CODE&gt; &lt;/CODE&gt;&lt;SPAN&gt;+&lt;/SPAN&gt;&lt;CODE&gt; currentphase&lt;/CODE&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;CODE&gt;DateModified &lt;/CODE&gt;&lt;SPAN&gt;+&lt;/SPAN&gt;&lt;CODE&gt; TextFormatting&lt;/CODE&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;CODE&gt;NewLine&lt;/CODE&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;
&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; result &lt;/CODE&gt;&lt;SPAN&gt;+=&lt;/SPAN&gt;&lt;CODE&gt; &lt;/CODE&gt;&lt;SPAN&gt;"Phase: "&lt;/SPAN&gt;&lt;CODE&gt; &lt;/CODE&gt;&lt;SPAN&gt;+&lt;/SPAN&gt;&lt;CODE&gt; currentphase&lt;/CODE&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;CODE&gt;ProjectPhase&lt;/CODE&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;
&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/CODE&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;CODE&gt; result&lt;/CODE&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;
&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;CODE&gt; &lt;/CODE&gt;&lt;SPAN&gt;else&lt;/SPAN&gt;&lt;CODE&gt; &lt;/CODE&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;
&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; result &lt;/CODE&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;CODE&gt; &lt;/CODE&gt;&lt;SPAN&gt;"There are no project phases defined"&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;
&lt;SPAN&gt;}&lt;/SPAN&gt;

&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;CODE&gt; result&lt;/CODE&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P style="line-height: 15.0pt; min-height: 8pt;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica',sans-serif; color: #666666;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="line-height: 15.0pt;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica',sans-serif; color: #666666;"&gt;If the data is related using a relationshipclass,&amp;nbsp;it can be done in a more easy way."&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="line-height: 15.0pt;"&gt;&lt;/P&gt;&lt;P style="line-height: 15.0pt;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica',sans-serif; color: #666666;"&gt;My question is for this last sentence.&amp;nbsp; I've setup my data now in ArcMap with relationship classes and published it as a feature layer.&amp;nbsp; Can you explain the easy way, please?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="line-height: 15.0pt;"&gt;&lt;/P&gt;&lt;P style="line-height: 15.0pt;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica',sans-serif; color: #666666;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="line-height: 15.0pt;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica',sans-serif; color: #666666;"&gt;Kelly&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:06:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293184#M14616</guid>
      <dc:creator>KellyDoss1</dc:creator>
      <dc:date>2021-12-11T14:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to get attribute with last date modified from related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293185#M14617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/people/Kelly.Doss_DurhamNC"&gt;Kelly.Doss_DurhamNC&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me create a dummy dataset and test some things out and I will get back to you with an example.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2019 15:39:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293185#M14617</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2019-12-12T15:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to get attribute with last date modified from related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293186#M14618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/364174" target="_blank"&gt;Kelly Doss&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an example of what I think you are trying to obtain:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" height="449" src="https://community.esri.com/legacyfs/online/476045_pastedImage_1.png" width="643" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The underlying Arcade expression is:&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; relatedrecords &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;OrderBy&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;FeatureSetByRelationshipName&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;$feature&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"RelData"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"DateModified DES"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; cnt &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Count&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;relatedrecords&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; relatedinfo &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;cnt &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; info &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;First&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;relatedrecords&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    relatedinfo &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; info&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ProjectPhase &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" ("&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Text&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;ToLocal&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;info&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;DateModified&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"MM/DD/Y"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;")"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; relatedinfo&lt;SPAN class="punctuation token"&gt;;&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&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;So, first the related records are obtained using the relationshipclass (ordering the result on DateModified). Then we use the count to know have many related records were found. When there&amp;nbsp;are any, the first record (most recent update) is retrieved and&amp;nbsp;some fields are formatted for presentation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:06:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293186#M14618</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-11T14:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to get attribute with last date modified from related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293187#M14619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much for taking the time to help me!  I’ll let you know if I have success.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kelly&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2019 16:25:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293187#M14619</guid>
      <dc:creator>KellyDoss1</dc:creator>
      <dc:date>2019-12-12T16:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to get attribute with last date modified from related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293188#M14620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have shared an AGO group with you that has my feature layer in it.  As I’ve been researching through Esri documentation and blog posts on how to create the desired dashboard, I’m wondering now if I’ll be able to even get there using the current data schema.  So before continuing with doing research, working out attribute expressions, and testing for my popups, I’d like to give you some history and what I’d like to accomplish.  I’d appreciate if you can let me know if it’s feasible and what would be needed to make it happen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our current Capital Projects viewer that was created many years ago in SQL is here:&lt;/P&gt;&lt;P&gt;http://cip.durhamnc.gov/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In its current state, it hasn’t been possible to have a mapping component because the only geographic information included is a parcel PIN, and that won’t work and is blank for many projects.  City management has requested that we create a more updated viewer that includes a map, and would like a dashboard that has charts and graphs as well.  Phase 1 of the overall project is creating the viewer using existing data.  For the mapping component, I created polygon and point (with many points for multipart polygons) feature classes with the Account Number, then joined and related tables that were exported from the existing SQL database; I tried adding a Query Layer, but it wouldn’t publish.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The feature layer in the group that I shared with you is these polygon and point layers and the related tables.  Ideally, I was hoping to make a Capital Projects Operations Dashboard&amp;lt;https://solutions.arcgis.com/local-government/help/capital-project-dashboard/&amp;gt; or use Web AppBuilder with the Dashboard theme.  It would include filters for Service Area, Fiscal Year, Completed Projects, etc., the popup panel would include Phase data, and there would be charts for the Expenditure and Financials tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this even possible with how the data is currently setup?  If not, do you have any suggestions on how to properly setup my data schema so that all needed data is in one table?  I’ve viewed the feature layer, map, and dashboard included with the Capital Projects Dashboard Solution to see its schema and settings, and, along with your popup arcade expression help, it is greatly helpful for the popups, but not for the expenditure and financial data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Phase 2 of the overall project is converting to a new system that can be used for all city projects, not just capital projects.  My department was going to test drive Aurigo, PPM software and an Esri partner, but that has hit a snag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for your time.  From reading through the blog posts and help requests, you are an incredible asset to the community!  I’ve been at my job for a little over a year now, and my whole team is learning all of the new AGO and Portal capabilities on the fly as needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kelly Doss, GISP&lt;/P&gt;&lt;P&gt;GIS Analyst&lt;/P&gt;&lt;P&gt;Technology Solutions Dept.&lt;/P&gt;&lt;P&gt;City of Durham&lt;/P&gt;&lt;P&gt;101 City Hall Plaza&lt;/P&gt;&lt;P&gt;Durham, NC 27701&lt;/P&gt;&lt;P&gt;P 919-560-4122 x33218&lt;/P&gt;&lt;P&gt;F 919-560-4808&lt;/P&gt;&lt;P&gt;Kelly.Doss@durhamnc.gov&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Dec 2019 17:14:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293188#M14620</guid>
      <dc:creator>KellyDoss1</dc:creator>
      <dc:date>2019-12-13T17:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to get attribute with last date modified from related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293189#M14621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/364174"&gt;Kelly Doss&lt;/A&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to open the CIP viewer, but&amp;nbsp;for some reason it won't open. I did not see an invitation in my messages when I entered ArcGIS Online. Can you share a link to your portal/group to see if I have access? I assume that I will be able to see the data there to be able to provide some feedback to the questions you asked.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As far as I understand your data in AGOL is static, since publishing query layers requires ArcGIS Enterprise with access to the SQL database. Also publishing data with joins can generate problems.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Operations Dashboard&amp;nbsp;can provide the tools to visualize the data you have. Using solutions and the proposed data&amp;nbsp;schema for local government can provide a lot of benefits. In case the Capital Project Dashboard does not contain all the features you want, you could consider providing an additional Dashboard to visualize the missing data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once I have access to the data, I can have a look at your data and see what is possible, but it might be a good thing to reach out to your local Esri account manager and sit down with him/her and a solution engineer from the local government team to have a better look at what you envision and learn about the options ArcGIS provides. This might be a good time to do that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Dec 2019 13:51:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293189#M14621</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2019-12-16T13:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to get attribute with last date modified from related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293190#M14622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Xander,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm working on a similar project and trying to pull an inspection date out of a related table.&amp;nbsp; My code is as follows:&lt;/P&gt;&lt;P&gt;&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; relatedrecords &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;OrderBy&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;FeatureSetByRelationshipName&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;$feature&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"AST_Inspection"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"insp_date"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; cnt &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Count&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;relatedrecords&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; relatedinfo &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;cnt &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; info &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;First&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;relatedrecords&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 relatedinfo &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Text&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;ToLocal&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;info&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;insp_date&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"MM/DD/Y"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; relatedrecords&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&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;When I test it returns results:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/482810_pastedImage_3.png" /&gt;&lt;/P&gt;&lt;P&gt;But in the pop up I've inserted the expression, it breaks the entire pop up and says No Information Available.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/482794_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where have I gone wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt; &lt;/CODE&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:06:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293190#M14622</guid>
      <dc:creator>TimFlynn</dc:creator>
      <dc:date>2021-12-11T14:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to get attribute with last date modified from related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293191#M14623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/354323"&gt;Tim Flynn&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Small change required in the expression. You are returning&amp;nbsp;"relatedrecords" which is a featureset you fetched on line 1 of your expression and you want to return "relatedinfo".&lt;/P&gt;&lt;P&gt;The featureset is shown in the test result, but a featureset cannot be shown in the pop-up. That is the reason.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Feb 2020 14:05:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293191#M14623</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2020-02-20T14:05:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to get attribute with last date modified from related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293192#M14624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Xander, thank you so much!&amp;nbsp; I knew it was something simple.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Feb 2020 14:36:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293192#M14624</guid>
      <dc:creator>TimFlynn</dc:creator>
      <dc:date>2020-02-20T14:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to get attribute with last date modified from related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293193#M14625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Xander,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works but now I've realized that for multiple inspections it will still only return the first inspection date.&amp;nbsp; What do I need to add to return the most recent inspection date?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&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; relatedrecords &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;OrderBy&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;FeatureSetByRelationshipName&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;$feature&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"AST_Inspection"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"insp_date"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; cnt &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Count&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;relatedrecords&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; relatedinfo &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;cnt &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; info &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;First&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;relatedrecords&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 relatedinfo &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Text&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;ToLocal&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;info&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;insp_date&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"MM/DD/Y"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; relatedrecords‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&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;I tried adding "Top(OrderBy(...),1)"&amp;nbsp; but that doesn't seem to make a difference.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:06:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293193#M14625</guid>
      <dc:creator>TimFlynn</dc:creator>
      <dc:date>2021-12-11T14:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to get attribute with last date modified from related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293194#M14626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Never mind&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/3100"&gt;Xander Bakker&lt;/A&gt;&amp;nbsp;I figured it out!&amp;nbsp; I simply added "insp_date DES" and that did the trick!&amp;nbsp; Also added a nifty else statement for empty lists.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for all the help in your many responses on these forums.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Feb 2020 15:21:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293194#M14626</guid>
      <dc:creator>TimFlynn</dc:creator>
      <dc:date>2020-02-20T15:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to get attribute with last date modified from related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293195#M14627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/354323" target="_blank"&gt;Tim Flynn&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Remember to return the relatedinfo and not the relatedrecords, but the key to get the&amp;nbsp;most recent date. This is done with the OrderBy, but on the first line the way to order the data was missing. Have a look at the end of the first line of the expression below:&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; relatedrecords &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;OrderBy&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;FeatureSetByRelationshipName&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;$feature&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"AST_Inspection"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"insp_date DESC"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; cnt &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Count&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;relatedrecords&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; relatedinfo &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;cnt &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; info &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;First&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;relatedrecords&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 relatedinfo &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Text&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;ToLocal&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;info&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;insp_date&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"MM/DD/Y"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; relatedinfo&lt;SPAN class="punctuation token"&gt;;&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:06:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293195#M14627</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-11T14:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to get attribute with last date modified from related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293196#M14628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I didn't see your responde before, but I'm glad you resolved it. It was the same thing I was proposing.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Feb 2020 15:29:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293196#M14628</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2020-02-20T15:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to get attribute with last date modified from related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293197#M14629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So is there a difference between adding in DES vs DESC?&amp;nbsp; Both seemed to work, at least while I have very few records in the data set.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Feb 2020 15:49:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293197#M14629</guid>
      <dc:creator>TimFlynn</dc:creator>
      <dc:date>2020-02-20T15:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to get attribute with last date modified from related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293198#M14630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/people/Timothy.Flynn_ocfl"&gt;Timothy.Flynn_ocfl&lt;/A&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As far as I know they are both valid options...&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Feb 2020 18:47:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293198#M14630</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2020-02-20T18:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to get attribute with last date modified from related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293199#M14631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/3100"&gt;Xander Bakker&lt;/A&gt;&amp;nbsp;and &lt;A href="https://community.esri.com/migrated-users/37491"&gt;Kelly Doss&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I really appreciate the code for displaying related records in the pop-up using the FeatureSetByRelationshipName. I have a question, I have a point layer with a related table and then a second related table to the first related table. This is from a Survey123 app in which points have related surveys and within the Survey123 there is a few repeat questions hence the second related table. Is it possible to access the second related table thru the pop-up with arcade and what function would you recommend? I would like to summarize counts in the second table displayed by most recent survey date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance!&lt;/P&gt;&lt;P&gt;Kathy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2020 23:55:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293199#M14631</guid>
      <dc:creator>kmsmikrud</dc:creator>
      <dc:date>2020-05-29T23:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to get attribute with last date modified from related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293200#M14632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/164269"&gt;Kathy Smikrud&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suppose that it should be possible feeding a row from the 1st related table&amp;nbsp;when fetching the 2nd related table using the same&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;FeatureSetByRelationshipName. If you can share the data I can look at it with more detail (AGOL user "xbakker@esri.co").&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2020 22:20:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293200#M14632</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2020-06-01T22:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to get attribute with last date modified from related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293201#M14633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/164269" target="_blank"&gt;Kathy Smikrud&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get the sum of the values in the repeat you can use the following expression:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;// Get the related surveys from feature&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; surveys &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;FeatureSetByRelationshipName&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;$feature&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"EscapementSurveys"&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;// get number of surveys&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; cnt1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Count&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;surveys&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; cnt2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// initialize values (ignore SPECIES_CODE)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; mouth &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// MOUTH&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; tidal &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// TIDAL&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; live &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// LIVE&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; dead &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// DEAD&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// check if there are any suveys available&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;cnt1 &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&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;// sort surveys on date&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; surveyssorted &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;OrderBy&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;surveys&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'OBS_Date DES'&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;// take most recent survey&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; survey &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;First&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;surveyssorted&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

    &lt;SPAN class="comment token"&gt;// get repeats for this survey&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; repeats &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;FeatureSetByRelationshipName&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;survey&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"repeat_SpeciesCounts"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    cnt2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Count&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;repeats&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;cnt2 &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&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;// we have repeats, now sum values&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; repeat &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; repeats&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
            mouth &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; repeat&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MOUTH&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
            tidal &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; repeat&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;TIDAL&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
            live &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; repeat&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;LIVE&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
            dead &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; repeat&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;DEAD&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        &lt;SPAN class="punctuation token"&gt;}&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;// create resulting text for pop-up&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;cnt2 &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&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;// there are repeats, so construct the resulting text&lt;/SPAN&gt;
    result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Mouth: "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; mouth&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    result &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; TextFormatting&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;NewLine &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Tidal: "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; tidal&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    result &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; TextFormatting&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;NewLine &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Live: "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; live&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    result &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; TextFormatting&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;NewLine &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Dead: "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; dead&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;// no repeats found, return a text to explain that&lt;/SPAN&gt;
    result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"No counts available"&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 the result&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; result&lt;SPAN class="punctuation token"&gt;;&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&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;See below the result in the pop-up:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/495350_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case you want to show the counts per specie code, you can use the expression below:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;// Get the related surveys from feature&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; surveys &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;FeatureSetByRelationshipName&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;$feature&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"EscapementSurveys"&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;// get number of surveys&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; cnt1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Count&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;surveys&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; cnt2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// check if there are any suveys available&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;cnt1 &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&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;// sort surveys on date&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; surveyssorted &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;OrderBy&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;surveys&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'OBS_Date DES'&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;// take most recent survey&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; survey &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;First&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;surveyssorted&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

    &lt;SPAN class="comment token"&gt;// get repeats for this survey&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; repeats &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;FeatureSetByRelationshipName&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;survey&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"repeat_SpeciesCounts"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

    cnt2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Count&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;repeats&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;cnt2 &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&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;// we have repeats, now aggregate the repeat per species: SPECIES_CODE&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; stats &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;GroupBy&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;repeats&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'SPECIES_CODE'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt; 
                &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;name&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'sumMOUTH'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; expression&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'MOUTH'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; statistic&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'SUM'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;name&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'sumTIDAL'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; expression&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'TIDAL'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; statistic&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'SUM'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;name&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'sumLIVE'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; expression&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'LIVE'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; statistic&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'SUM'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
                &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;name&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'sumDEAD'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; expression&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'DEAD'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; statistic&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'SUM'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&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;// read the aggregation and create the text&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; stat &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; stats&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
                result &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; TextFormatting&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;NewLine &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; TextFormatting&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;NewLine &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Specie code: "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; stat&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"SPECIES_CODE"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
                result &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; TextFormatting&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;NewLine &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" - "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;  &lt;SPAN class="string token"&gt;"Mouth: "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; stat&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;sumMOUTH&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
                result &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; TextFormatting&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;NewLine &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" - "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Tidal: "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; stat&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;sumTIDAL&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
                result &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; TextFormatting&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;NewLine &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" - "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Live: "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; stat&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;sumLIVE&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
                result &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; TextFormatting&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;NewLine &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" - "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Dead: "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; stat&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;sumDEAD&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
    &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
        result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"No counts available"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"No counts available"&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 the result&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; result&lt;SPAN class="punctuation token"&gt;;&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&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;The result will display as this:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/495351_pastedImage_3.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your email you mentioned that you want to access the previous survey counts, so not the latest record. In that case you would still have to sort the surveys on date but now loop through the surveys and take the second. This is a bit longer than using the First function, but it can be done.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:06:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293201#M14633</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-11T14:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to get attribute with last date modified from related table using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293202#M14634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/3100"&gt;Xander Bakker&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;THANK-YOU SO MUCH!&lt;/STRONG&gt; The latter code is exactly what I was hoping to do but unable to put the code together in how to access the counts in the second related table. In regards to accessing all previous survey counts at this time the goal was just to access the last survey count which is what you provided. I can't tell you how much I appreciate your help on this and its very exciting to see the results show up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am curious if the arcade will work offline in the Collector for ArcGIS app with iOS device which is really the goal for surveyors to be able to view previous survey counts when they are out. If this functionality isn't available now hopefully it is on the road map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again thank-you so much for your time in looking at the data and sharing the code!&lt;/P&gt;&lt;P&gt;Kathy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jun 2020 14:56:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-get-attribute-with-last-date-modified-from/m-p/293202#M14634</guid>
      <dc:creator>kmsmikrud</dc:creator>
      <dc:date>2020-06-04T14:56:36Z</dc:date>
    </item>
  </channel>
</rss>

