<?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 Generate feature report with most recent related record/max value in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/generate-feature-report-with-most-recent-related/m-p/1255581#M47330</link>
    <description>&lt;P&gt;I have a feature layer representing electric utility structures, with a related table for inspections. I'm attempting to create a feature report with a record for each structure, along with information about the most recent inspection record in the related table as defined by a date field for the inspection date&lt;/P&gt;&lt;P&gt;I've successfully used the Stats method with max to get the most recent inspection date, but I can't figure out how to call that variable in a where clause to define the values for the other fields coming from the related table.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JosephRhodes2_1-1675733843106.png" style="width: 581px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/62221i0F8DB918AD5875AB/image-dimensions/581x109?v=v2" width="581" height="109" role="button" title="JosephRhodes2_1-1675733843106.png" alt="JosephRhodes2_1-1675733843106.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Any ideas would be much appreciated.&lt;/P&gt;</description>
    <pubDate>Tue, 07 Feb 2023 02:53:11 GMT</pubDate>
    <dc:creator>JRhodes</dc:creator>
    <dc:date>2023-02-07T02:53:11Z</dc:date>
    <item>
      <title>Generate feature report with most recent related record/max value</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/generate-feature-report-with-most-recent-related/m-p/1255581#M47330</link>
      <description>&lt;P&gt;I have a feature layer representing electric utility structures, with a related table for inspections. I'm attempting to create a feature report with a record for each structure, along with information about the most recent inspection record in the related table as defined by a date field for the inspection date&lt;/P&gt;&lt;P&gt;I've successfully used the Stats method with max to get the most recent inspection date, but I can't figure out how to call that variable in a where clause to define the values for the other fields coming from the related table.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JosephRhodes2_1-1675733843106.png" style="width: 581px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/62221i0F8DB918AD5875AB/image-dimensions/581x109?v=v2" width="581" height="109" role="button" title="JosephRhodes2_1-1675733843106.png" alt="JosephRhodes2_1-1675733843106.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Any ideas would be much appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 02:53:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/generate-feature-report-with-most-recent-related/m-p/1255581#M47330</guid>
      <dc:creator>JRhodes</dc:creator>
      <dc:date>2023-02-07T02:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: Generate feature report with most recent related record/max value</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/generate-feature-report-with-most-recent-related/m-p/1255839#M47354</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/97885"&gt;@JRhodes&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;You could set the result record count for the inspection repeat to one and order the fields by the inspection date. Then you should still be able to add a where filter if needed. So something like this:&lt;BR /&gt;&lt;BR /&gt;${#inspection_repeat| where:"1=1"|orderByFields:"inspection_date DESC" | resultRecordCount:1}&lt;BR /&gt;&lt;BR /&gt;${inspector} ${defect} ${action}&lt;/P&gt;&lt;P&gt;${/}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- Barbara&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 19:09:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/generate-feature-report-with-most-recent-related/m-p/1255839#M47354</guid>
      <dc:creator>BarbaraWebster1</dc:creator>
      <dc:date>2023-02-07T19:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Generate feature report with most recent related record/max value</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/generate-feature-report-with-most-recent-related/m-p/1255878#M47357</link>
      <description>&lt;P&gt;Thanks so much Barbara! I was able to get that to work, but I had to pull the leftmost three columns (parent info) out of the table; otherwise, I got "&lt;SPAN&gt;Failed to parse &lt;/SPAN&gt;&lt;I&gt;${FACILITYID}&lt;/I&gt;&lt;SPAN&gt; since &lt;/SPAN&gt;&lt;I&gt;FACILITYID&lt;/I&gt;&lt;SPAN&gt; cannot be found in the current parsing scope.&lt;/SPAN&gt;".&lt;/P&gt;&lt;P&gt;So, I was able to do this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JosephRhodes2_0-1675800908991.png" style="width: 523px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/62295iC8CB08D7DA77BD7C/image-dimensions/523x145?v=v2" width="523" height="145" role="button" title="JosephRhodes2_0-1675800908991.png" alt="JosephRhodes2_0-1675800908991.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But I was unable to put it all in a line in a single table, like the example in my post. Is it possible to put the parent info and a single related record in a table row within a single table? I tried putting the open/close parent tags both inside the table and outside the table, and both gave the parsing scope error on the first attribute the template was attempting to pull from the parent table.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 20:23:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/generate-feature-report-with-most-recent-related/m-p/1255878#M47357</guid>
      <dc:creator>JRhodes</dc:creator>
      <dc:date>2023-02-07T20:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: Generate feature report with most recent related record/max value</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/generate-feature-report-with-most-recent-related/m-p/1255897#M47359</link>
      <description>&lt;P&gt;Unfortunately I believe there's a limitation that prevents parent and repeat records from being on the same line in a table when exporting multiple parent records, however you can get all the records in the same table by putting the repeat record on a line below the parent record.&lt;BR /&gt;&lt;BR /&gt;Template:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BarbaraWebster1_0-1675802851768.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/62300iDC2609B7FD5D9327/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BarbaraWebster1_0-1675802851768.png" alt="BarbaraWebster1_0-1675802851768.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Export:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BarbaraWebster1_1-1675802868672.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/62301i6CF2CD024AE7CE30/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BarbaraWebster1_1-1675802868672.png" alt="BarbaraWebster1_1-1675802868672.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 20:52:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/generate-feature-report-with-most-recent-related/m-p/1255897#M47359</guid>
      <dc:creator>BarbaraWebster1</dc:creator>
      <dc:date>2023-02-07T20:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: Generate feature report with most recent related record/max value</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/generate-feature-report-with-most-recent-related/m-p/1255898#M47360</link>
      <description>&lt;P&gt;Thanks again Barbara. I think one of these approaches will meet our needs.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 20:54:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/generate-feature-report-with-most-recent-related/m-p/1255898#M47360</guid>
      <dc:creator>JRhodes</dc:creator>
      <dc:date>2023-02-07T20:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: Generate feature report with most recent related record/max value</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/generate-feature-report-with-most-recent-related/m-p/1255899#M47361</link>
      <description>&lt;P&gt;No problem, glad to help!&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 20:56:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/generate-feature-report-with-most-recent-related/m-p/1255899#M47361</guid>
      <dc:creator>BarbaraWebster1</dc:creator>
      <dc:date>2023-02-07T20:56:27Z</dc:date>
    </item>
  </channel>
</rss>

