<?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: Is it possible to pull data from the most recently submitted survey? in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/is-it-possible-to-pull-data-from-the-most-recently/m-p/1126361#M39287</link>
    <description>&lt;P&gt;From what I understood Philip, I would be able to use java to get the last record inside a repeat. These links do not include the last record submitted to the survey.&amp;nbsp;&lt;BR /&gt;Is there anything that I am missing?&lt;/P&gt;</description>
    <pubDate>Wed, 15 Dec 2021 18:09:31 GMT</pubDate>
    <dc:creator>AnaDeniston</dc:creator>
    <dc:date>2021-12-15T18:09:31Z</dc:date>
    <item>
      <title>Is it possible to pull data from the most recently submitted survey?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/is-it-possible-to-pull-data-from-the-most-recently/m-p/854892#M24484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a box in my survey for sample numbers and I'd love to prepopulate it with a calculation. The sample number is always X+1, where X is the previously collected sample number.&amp;nbsp;Is it possible to pull data from the most recently submitted survey so I can get this X?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2020 19:32:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/is-it-possible-to-pull-data-from-the-most-recently/m-p/854892#M24484</guid>
      <dc:creator>KateBerg2</dc:creator>
      <dc:date>2020-08-13T19:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to pull data from the most recently submitted survey?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/is-it-possible-to-pull-data-from-the-most-recently/m-p/854893#M24485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kate,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No, it is not possible to query data locally on the device from a previously submitted record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, you could use a custom JavaScript function and the pulldata @ JavaScript feature to query the feature layer and return the last submitted value for the sample number field. This would require the user and device to be online and have access to the feature layer, and only work when the previous record has already been submitted (ie not in the Drafts or Outbox).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check out&amp;nbsp;&lt;A class="link-titled" href="https://doc.arcgis.com/en/survey123/desktop/create-surveys/pulldatajavascript.htm" title="https://doc.arcgis.com/en/survey123/desktop/create-surveys/pulldatajavascript.htm"&gt;JavaScript functions in survey forms—ArcGIS Survey123 | Documentation&lt;/A&gt;&amp;nbsp;and&amp;nbsp;&lt;A href="https://community.esri.com/groups/survey123/blog/2020/08/07/extending-survey123-smart-forms-with-custom-js-functions"&gt;https://community.esri.com/groups/survey123/blog/2020/08/07/extending-survey123-smart-forms-with-custom-js-functions&lt;/A&gt;&amp;nbsp;for more information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise check out this blog post which relates to auto-incrementing "ticket numbers" which sounds similar to what you are wanting to do&amp;nbsp;&lt;A href="https://community.esri.com/groups/survey123/blog/2017/11/25/creating-ticket-numbers-in-survey123-for-arcgis"&gt;https://community.esri.com/groups/survey123/blog/2017/11/25/creating-ticket-numbers-in-survey123-for-arcgis&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Phil.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Aug 2020 03:24:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/is-it-possible-to-pull-data-from-the-most-recently/m-p/854893#M24485</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-08-14T03:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to pull data from the most recently submitted survey?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/is-it-possible-to-pull-data-from-the-most-recently/m-p/1126358#M39286</link>
      <description>&lt;P&gt;Heey Kate,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Were you able to figure out how to do this? I am running into the same issue.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 18:07:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/is-it-possible-to-pull-data-from-the-most-recently/m-p/1126358#M39286</guid>
      <dc:creator>AnaDeniston</dc:creator>
      <dc:date>2021-12-15T18:07:17Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to pull data from the most recently submitted survey?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/is-it-possible-to-pull-data-from-the-most-recently/m-p/1126361#M39287</link>
      <description>&lt;P&gt;From what I understood Philip, I would be able to use java to get the last record inside a repeat. These links do not include the last record submitted to the survey.&amp;nbsp;&lt;BR /&gt;Is there anything that I am missing?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 18:09:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/is-it-possible-to-pull-data-from-the-most-recently/m-p/1126361#M39287</guid>
      <dc:creator>AnaDeniston</dc:creator>
      <dc:date>2021-12-15T18:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to pull data from the most recently submitted survey?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/is-it-possible-to-pull-data-from-the-most-recently/m-p/1127019#M39330</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/524206"&gt;@AnaDeniston&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;As mentioned in chat, the only way you can get a value from a previous record if after it is submitted and hosted int he feature layer, if you know the ID or a way to look it up. There are some other options you could try:&lt;/P&gt;&lt;P&gt;Here is a blog to search() appearance:&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-survey123-blog/dynamic-choice-lists-using-search-appearance/ba-p/1060838" target="_blank" rel="noopener"&gt;Dynamic Choice Lists using Search Appearance - Esri Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Also here is the doc for Linked Content:&amp;nbsp;&lt;A href="https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformessentials.htm#ESRI_SECTION1_34A4D88BA6A64C48AA0E113DC61099DD" target="_blank" rel="nofollow noopener noreferrer"&gt;https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformessentials.htm#ESRI_SECTION1_34A4D...&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Otherwise the best option is still to use a JS function.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Phil.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Dec 2021 23:58:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/is-it-possible-to-pull-data-from-the-most-recently/m-p/1127019#M39330</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-16T23:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to pull data from the most recently submitted survey?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/is-it-possible-to-pull-data-from-the-most-recently/m-p/1227706#M45791</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/79461"&gt;@KateBerg2&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/524206"&gt;@AnaDeniston&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did either of you figure this out?&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2022 22:00:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/is-it-possible-to-pull-data-from-the-most-recently/m-p/1227706#M45791</guid>
      <dc:creator>JerrySneary</dc:creator>
      <dc:date>2022-11-01T22:00:31Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to pull data from the most recently submitted survey?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/is-it-possible-to-pull-data-from-the-most-recently/m-p/1231489#M46023</link>
      <description>&lt;P&gt;Hi Jerry,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, I created a script that pulls the data from ArcGIS online feature layer.&lt;/P&gt;&lt;P&gt;Here is the script:&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;function myfunction(token, debugmode){&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;var featureLayer = &lt;FONT color="#FF0000"&gt;"&lt;A href="https://services.arcgis.com/....../FeatureServer/0" target="_blank"&gt;https://services.arcgis.com/....../FeatureServer/0&lt;/A&gt;"&lt;/FONT&gt;; #URL of the feature layer&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;var xmlhttp = new XMLHttpRequest();&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;var url = featureLayer + "/query?where=1=1&amp;amp;outFields=*&amp;amp;f=json"&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;if (token){&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;url = url + "&amp;amp;token=" + token;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;}&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;xmlhttp.open("GET",url,false);&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;xmlhttp.send();&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;if (xmlhttp.status!==200){&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;return (debugmode? xmlhttp.status:"");&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;} else {&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;var responseJSON=JSON.parse(xmlhttp.responseText)&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;if (responseJSON.error){&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;return (debugmode? JSON.stringify(responseJSON.error):"");&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;} else {&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;if (responseJSON.features[0]){&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;return JSON.stringify(responseJSON.features[responseJSON.features.length - 1]);&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;}else{&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;return (debugmode? "No Features Found":"");&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;}&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;}&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;}&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;}&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what my XLSForm looks like:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AnaDeniston_0-1668463192056.png" style="width: 710px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/55931iC50D91229CBCA959/image-dimensions/710x126?v=v2" width="710" height="126" role="button" title="AnaDeniston_0-1668463192056.png" alt="AnaDeniston_0-1668463192056.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Notice that you can get any attribute that you want from the last reads by using this:&lt;/P&gt;&lt;P&gt;pulldata("@json", ${myJava}, "attributes.&lt;FONT color="#FF0000"&gt;Date&lt;/FONT&gt;")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if you have any questions,&lt;/P&gt;&lt;P&gt;Ana&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 22:02:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/is-it-possible-to-pull-data-from-the-most-recently/m-p/1231489#M46023</guid>
      <dc:creator>AnaDeniston</dc:creator>
      <dc:date>2022-11-14T22:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to pull data from the most recently submitted survey?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/is-it-possible-to-pull-data-from-the-most-recently/m-p/1259174#M47524</link>
      <description>&lt;P&gt;Hi Ana. Thank you very much for sharing your solution, super helpful.&lt;/P&gt;&lt;P&gt;Question: Is your JS function taking any of the users responses as parameters for the pulldata function? Sorry for the noob question, I am not familiar with JS. In my scenario, I need a user to select a location, then for my JS function to pull a quantity from the last time that location had a survey submitted.&lt;/P&gt;&lt;P&gt;Thank you in advance for any insight!&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2023 23:42:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/is-it-possible-to-pull-data-from-the-most-recently/m-p/1259174#M47524</guid>
      <dc:creator>RodrigoLopez</dc:creator>
      <dc:date>2023-02-16T23:42:39Z</dc:date>
    </item>
  </channel>
</rss>

