<?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 Pull in Most Recent Date Inspected from one Layer into another in Pop-Up Using Arcade in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/pull-in-most-recent-date-inspected-from-one-layer/m-p/1317374#M53854</link>
    <description>&lt;P&gt;I am working on configuring the pop-ups on our hydrant layer to automatically pull in the most recent date inspected from a different layer: Hydrant Inspection layer. I want it to pull the most recent date if there is more than one date inspected for a given hydrant, which in many cases there are. I have been wracking my brain on an arcade statement but nothing I get works. I am not sure if I need to do an Intersects function with hydrant or OrderBy or First. I am lost.&amp;nbsp; I would even love to have it pull in as an attribute rule inside of ArcGIS pro for the layer but for now I will settle on getting an arcade for the pop-up. If anyone has any suggestions, they would be much appreciated.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Aug 2023 13:56:49 GMT</pubDate>
    <dc:creator>MelanieBass</dc:creator>
    <dc:date>2023-08-10T13:56:49Z</dc:date>
    <item>
      <title>Pull in Most Recent Date Inspected from one Layer into another in Pop-Up Using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/pull-in-most-recent-date-inspected-from-one-layer/m-p/1317374#M53854</link>
      <description>&lt;P&gt;I am working on configuring the pop-ups on our hydrant layer to automatically pull in the most recent date inspected from a different layer: Hydrant Inspection layer. I want it to pull the most recent date if there is more than one date inspected for a given hydrant, which in many cases there are. I have been wracking my brain on an arcade statement but nothing I get works. I am not sure if I need to do an Intersects function with hydrant or OrderBy or First. I am lost.&amp;nbsp; I would even love to have it pull in as an attribute rule inside of ArcGIS pro for the layer but for now I will settle on getting an arcade for the pop-up. If anyone has any suggestions, they would be much appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2023 13:56:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/pull-in-most-recent-date-inspected-from-one-layer/m-p/1317374#M53854</guid>
      <dc:creator>MelanieBass</dc:creator>
      <dc:date>2023-08-10T13:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: Pull in Most Recent Date Inspected from one Layer into another in Pop-Up Using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/pull-in-most-recent-date-inspected-from-one-layer/m-p/1317642#M53863</link>
      <description>&lt;LI-CODE lang="javascript"&gt;var all_inspections = FeaturesetByName($map, "Inspections")

var hydrant_id = $feature.HydrantID
var hydrant_inspections = Filter(all_inspections, "HydrantID = @hydrant_id")

var sorted_inspections = OrderBy(hydrant_inspections, "InspectionDate DESC")

var latest_inspection = First(sorted_inspections)
if(latest_inspection == null) { return "No inspection found" }

return latest_inspection.InspectionDate&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 10 Aug 2023 19:57:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/pull-in-most-recent-date-inspected-from-one-layer/m-p/1317642#M53863</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-08-10T19:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: Pull in Most Recent Date Inspected from one Layer into another in Pop-Up Using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/pull-in-most-recent-date-inspected-from-one-layer/m-p/1317661#M53866</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;all_inspections&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;FeaturesetByName&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$map&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"Hydrant Inspections"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;hydrant_id&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;$feature&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;HydrantID&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;hydrant_inspections&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;Filter&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;all_inspections&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"HydrantID = @hydrant_id"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;sorted_inspections&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;OrderBy&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;hydrant_inspections&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"DateInspected DESC"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;latest_inspection&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;First&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;sorted_inspections&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;latest_inspection&lt;/SPAN&gt;&lt;SPAN&gt; == &lt;/SPAN&gt;&lt;SPAN&gt;'December 29, 1899'&lt;/SPAN&gt;&lt;SPAN&gt;) { &lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;"No inspection found"&lt;/SPAN&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;latest_inspection&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;DateInspected&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;this is what I put in and I am getting the invalid parameter error. Is the "DateInspected DESC" supposed to be a field? The field for Date Inspected is DateInspected. Any other suggestions? Thank you for your help! I appreciate it.&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294341"&gt;@JohannesLindner&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 14 Aug 2023 17:55:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/pull-in-most-recent-date-inspected-from-one-layer/m-p/1317661#M53866</guid>
      <dc:creator>MelanieBass</dc:creator>
      <dc:date>2023-08-14T17:55:31Z</dc:date>
    </item>
  </channel>
</rss>

