<?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: On Inserting a new record, populate past measurement in ArcGIS Field Maps Questions</title>
    <link>https://community.esri.com/t5/arcgis-field-maps-questions/on-inserting-a-new-record-populate-past/m-p/1605752#M10721</link>
    <description>&lt;P&gt;I would use FeatureSetByRelationshipName instead.&amp;nbsp; Here you are just giving it the name 1 which I doubt its called that.&amp;nbsp; I am also not sure if a calculated value fires right away or on submit.&amp;nbsp; You can use just a note field to display it as well.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Apr 2025 18:18:50 GMT</pubDate>
    <dc:creator>DougBrowning</dc:creator>
    <dc:date>2025-04-14T18:18:50Z</dc:date>
    <item>
      <title>On Inserting a new record, populate past measurement</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/on-inserting-a-new-record-populate-past/m-p/1605706#M10720</link>
      <description>&lt;P&gt;Hi, I am attempting to collect repeated inspection data for the first time. I have a tree feature class with a related table of measurements. We have equipment installed on each tree that will be re-measured biweekly.&lt;/P&gt;&lt;P&gt;I would like to:&lt;/P&gt;&lt;P&gt;1. Pull the previous measurement entered into the related table the week before into a field of the related table to perform a calculation check. (There is a 'measure' field and a 'prevMeasure' field).&lt;/P&gt;&lt;P&gt;2. Create an alert for the field crew to real-time 'see' that a measurement is out of range. (There is a 'measurementCheck') field.&lt;/P&gt;&lt;P&gt;I have found all sort of documentation to&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-field-maps-questions/calculated-expression-works-in-agol-web-map-but/m-p/1603372#M10693" target="_self"&gt;extract a value from the related table to the Parent feature class&lt;/A&gt; and can successfully show those values in a text box on the feature class pop-up.&lt;/P&gt;&lt;P&gt;It doesn't seem that you can use &lt;A href="https://community.esri.com/t5/arcgis-field-maps-questions/update-previous-inspection-date/td-p/1315895" target="_self"&gt;$editcontext.editType == 'INSERT' to return the $originalFeature&lt;/A&gt; on a related table.&lt;/P&gt;&lt;P&gt;It would be really helpful to show the field crew if there is a measurement error immediately. Is there a way to pull in a past measurement to the new record of a related table? I have tried the code below, and the value does return when running it in Field Maps Designer, but the app freezes when I attempt to 'Add' a new record to the related table...&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var prevData = OrderBy(FeatureSetByName($datastore, "1", ['measureDate', "prevMeasure"], false), "measureDate DESC")
var f = First(prevData)
Console(f)
return f.prevMeasure&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 14 Apr 2025 16:38:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/on-inserting-a-new-record-populate-past/m-p/1605706#M10720</guid>
      <dc:creator>JessicaShue</dc:creator>
      <dc:date>2025-04-14T16:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: On Inserting a new record, populate past measurement</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/on-inserting-a-new-record-populate-past/m-p/1605752#M10721</link>
      <description>&lt;P&gt;I would use FeatureSetByRelationshipName instead.&amp;nbsp; Here you are just giving it the name 1 which I doubt its called that.&amp;nbsp; I am also not sure if a calculated value fires right away or on submit.&amp;nbsp; You can use just a note field to display it as well.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Apr 2025 18:18:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/on-inserting-a-new-record-populate-past/m-p/1605752#M10721</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2025-04-14T18:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: On Inserting a new record, populate past measurement</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/on-inserting-a-new-record-populate-past/m-p/1605767#M10722</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/16421"&gt;@DougBrowning&lt;/a&gt;. When writing Arcade code, I do tend to rely on the 'Profile Variables' and 'Functions' help on the right-hand side of the Arcade window. When I look under $datastore, for 'FeatureSetByID' it does list my related table as "1"; but as I'm not using 'ByID' maybe that isn't the correct thing to use.&lt;/P&gt;&lt;P&gt;I'm having a bit of trouble with the website this afternoon, may be the internet at my work. I will try to test things out again in the morning. I know you respond to a lot of these questions, so thank you very much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Apr 2025 19:02:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/on-inserting-a-new-record-populate-past/m-p/1605767#M10722</guid>
      <dc:creator>JessicaShue</dc:creator>
      <dc:date>2025-04-14T19:02:42Z</dc:date>
    </item>
  </channel>
</rss>

