<?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: Pull date from previous record in a child table in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/pull-date-from-previous-record-in-a-child-table/m-p/1546352#M88977</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/461167"&gt;@AustinPhelps1&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;This sounds very similar to on of our current projects which uses relationship classes (1:Many) with related table information being pulled into our parent table's popup.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is example for what we did to pull the top 3 records and diplay in a popup. I believe you could just pull the top one record instead.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Amanda__Huber_0-1728338637841.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/116669iAD980A1451CD77CA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Amanda__Huber_0-1728338637841.png" alt="Amanda__Huber_0-1728338637841.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I believe you might need the "Top()" function for your script for it to work.&amp;nbsp;&lt;STRONG&gt;&lt;A href="https://developers.arcgis.com/arcade/function-reference/featureset_functions/#top" target="_blank"&gt;https://developers.arcgis.com/arcade/function-reference/featureset_functions/#top&lt;/A&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Amanda__Huber_1-1728338752389.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/116670iFCFBC7A2780A0109/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Amanda__Huber_1-1728338752389.png" alt="Amanda__Huber_1-1728338752389.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Best,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Amanda Huber&lt;/P&gt;</description>
    <pubDate>Mon, 07 Oct 2024 22:13:55 GMT</pubDate>
    <dc:creator>Amanda__Huber</dc:creator>
    <dc:date>2024-10-07T22:13:55Z</dc:date>
    <item>
      <title>Pull date from previous record in a child table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/pull-date-from-previous-record-in-a-child-table/m-p/1546327#M88969</link>
      <description>&lt;P&gt;I am trying to calculate a field in field maps using the arcade expression.&lt;/P&gt;&lt;P&gt;I have a parent/child relationship and I need to pull the last recording date to populate a field on the new record created.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what I have, and it is currently not working. What am I missing in my expression?&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;//Fetch the related inspections from the related table using the relationship name&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;inspections&lt;/SPAN&gt; = &lt;SPAN&gt;FeatureSetByRelationshipName&lt;/SPAN&gt;(&lt;SPAN&gt;$feature&lt;/SPAN&gt;, &lt;SPAN&gt;"Corrosometer_Probe_Data_Records"&lt;/SPAN&gt;, [&lt;SPAN&gt;"Read_Date"&lt;/SPAN&gt;], &lt;SPAN&gt;false&lt;/SPAN&gt;);&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;//Sort inspections by the read date in descending order to get the most recent&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;sortedInspections&lt;/SPAN&gt; = &lt;SPAN&gt;OrderBy&lt;/SPAN&gt;(&lt;SPAN&gt;inspections&lt;/SPAN&gt;, &lt;SPAN&gt;"Read_Date DESC"&lt;/SPAN&gt;);&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;//Get the first (latest) inspection date&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;latestInspection&lt;/SPAN&gt; = &lt;SPAN&gt;First&lt;/SPAN&gt;(&lt;SPAN&gt;sortedInspections&lt;/SPAN&gt;);&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;//If there are previous inspections, get the date of the latest inspection&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if&lt;/SPAN&gt; (!&lt;SPAN&gt;IsEmpty&lt;/SPAN&gt;(&lt;SPAN&gt;latestInspection&lt;/SPAN&gt;)) {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;latestInspection&lt;/SPAN&gt;[&lt;SPAN&gt;"Read_Date"&lt;/SPAN&gt;];&lt;/DIV&gt;&lt;DIV&gt;} &lt;SPAN&gt;else&lt;/SPAN&gt; {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &lt;SPAN&gt;//If no previous inspections exist, return null or a default value&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;null&lt;/SPAN&gt;;&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks for any help!&lt;/DIV&gt;</description>
      <pubDate>Mon, 07 Oct 2024 21:53:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/pull-date-from-previous-record-in-a-child-table/m-p/1546327#M88969</guid>
      <dc:creator>AustinPhelps1</dc:creator>
      <dc:date>2024-10-07T21:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: Pull date from previous record in a child table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/pull-date-from-previous-record-in-a-child-table/m-p/1546352#M88977</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/461167"&gt;@AustinPhelps1&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;This sounds very similar to on of our current projects which uses relationship classes (1:Many) with related table information being pulled into our parent table's popup.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is example for what we did to pull the top 3 records and diplay in a popup. I believe you could just pull the top one record instead.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Amanda__Huber_0-1728338637841.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/116669iAD980A1451CD77CA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Amanda__Huber_0-1728338637841.png" alt="Amanda__Huber_0-1728338637841.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I believe you might need the "Top()" function for your script for it to work.&amp;nbsp;&lt;STRONG&gt;&lt;A href="https://developers.arcgis.com/arcade/function-reference/featureset_functions/#top" target="_blank"&gt;https://developers.arcgis.com/arcade/function-reference/featureset_functions/#top&lt;/A&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Amanda__Huber_1-1728338752389.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/116670iFCFBC7A2780A0109/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Amanda__Huber_1-1728338752389.png" alt="Amanda__Huber_1-1728338752389.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Best,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Amanda Huber&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2024 22:13:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/pull-date-from-previous-record-in-a-child-table/m-p/1546352#M88977</guid>
      <dc:creator>Amanda__Huber</dc:creator>
      <dc:date>2024-10-07T22:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: Pull date from previous record in a child table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/pull-date-from-previous-record-in-a-child-table/m-p/1546490#M88984</link>
      <description>&lt;P&gt;Doesn't seem to have worked, but thank you for the suggestion. I keep getting this when running it:&amp;nbsp;&lt;SPAN&gt;Test execution error: Execution error - Invalid parameter. Verify test data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AustinPhelps1_0-1728392795672.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/116728i841381A714A25025/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AustinPhelps1_0-1728392795672.png" alt="AustinPhelps1_0-1728392795672.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have 1500 records in my child table and 28 points in the parent so I know there is data in them&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2024 13:09:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/pull-date-from-previous-record-in-a-child-table/m-p/1546490#M88984</guid>
      <dc:creator>AustinPhelps1</dc:creator>
      <dc:date>2024-10-08T13:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: Pull date from previous record in a child table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/pull-date-from-previous-record-in-a-child-table/m-p/1546494#M88986</link>
      <description>&lt;P&gt;Try adding this as well, this matches up the parent's GlobalID with the related table's GUID so it knows what parent record to pull from.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Amanda__Huber_0-1728393376343.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/116729iF5BE67DCCA486824/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Amanda__Huber_0-1728393376343.png" alt="Amanda__Huber_0-1728393376343.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Best of luck,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Amanda Huber&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2024 13:18:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/pull-date-from-previous-record-in-a-child-table/m-p/1546494#M88986</guid>
      <dc:creator>Amanda__Huber</dc:creator>
      <dc:date>2024-10-08T13:18:15Z</dc:date>
    </item>
  </channel>
</rss>

