Select to view content in your preferred language

Update Field From Last Survey

239
5
07-10-2025 07:40 AM
allyf
by
Emerging Contributor

I am making an inspection form for people to fill out. There are a lot of questions that are highly likely to stay the same every inspection. I want to be able to autopopulate the field with their previous answer. 

With a test survey, I successfully got it to pull the submitted data from the feature layer and bring it into the survey. However, when I add a new survey response with different answers it does not update. For example I did one survey with ID 1 and blue, then that worked but after doing ID 1 with green it still displayed blue. 

I have it sorted by an automatic now() datetime. I also have looked in the test query and tested to see the most recent response with the same sort parameters and the output was correct. I attached an image of my form, I'm sorry it is not the correct format - I'm not sure how to upload it as a document preview of the xlsx form!

Any help would be appreciated. Thank you!

 

0 Kudos
5 Replies
allyf
by
Emerging Contributor

Thank you! I tried all of the suggestions in those posts. Unfortunately, it didn't work. I'm not sure if it's a cache issue though because if I deleted the first response, then it updates to what was the second response.

0 Kudos
Neal_t_k
Frequent Contributor

In that case, maybe try sorting by a different field,  You could try descending on objectid or creationdate and see if that makes a difference.

0 Kudos
allyf
by
Emerging Contributor

I have tried both of those. I was also pretty sure I could confirm that it should be ordered correctly because I ran a sample query. I am stumped! Thank you though.

0 Kudos
Neal_t_k
Frequent Contributor

@allyf Just noticed you have your sort and records at the end of your query, they should be part of the url. Try this: 

pulldata("@layer", "getValue", "attributes.select_q", "<url>?orderByFields=Current_DT DESC&resultRecordCount=1", ${whclause1})

 

 https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm#ESRI_SECTION1_BB97985...

(Request parameters section)

0 Kudos