Survey123 - Prepopulating answers based on a previous submission

1183
7
12-19-2022 05:22 AM
HeatherAdams1983
New Contributor II

Hi there, I've created a survey for a cycling and walking network consultation in Survey123 with a map to drop a pin on to identify specific locations in the network which may have issues, such as poor quality surfaces. Respondents may wish to comment on a number of different locations and submit the survey several times. At the start the survey contains various demographic questions, relating to age group, occupation, gender etc. I was hoping to find a way to avoid respondents having to fill these questions each time they submit a survey. I know that in draft mode answers to questions are saved by cookies in the browser so that unsubmitted surveys can be completed later. But once a survey has been submitted, can this information be used to pre-populate some answers in a new survey? So that these questions, the answers to which, should remain the same each time a respondent submits a survey, don't have to be filled our each time a survey is submitted, as this could be multiple times. Thanks for your help

0 Kudos
7 Replies
JenniferAcunto
Esri Regular Contributor

You can use the generated_note_prompt_submitted and URL parameters to display a link to submit a new survey after they have submitted. This link will auto-populate the name and any other fields you want. They can then bookmark that link if they are going to be filling it out in the future. 

Notes

Web Form URL Parameters

- Jen
0 Kudos
HeatherAdams1983
New Contributor II

Hi Jen, thanks for your reply. Would this be done with the 'mode' parameter and value 'copy'? If this is the case would I have to know the values for the fields I want to copy? I was hoping that this information could be obtained from the browser somehow like when it draft mode, but instead from the previously submitted survey. So that the respondent could submit all their responses in one go if needed, but only having to answer certain questions once, as the values for them would be prepopulated from their previously submitted survey. Maybe this isn't possible.

0 Kudos
JenniferAcunto
Esri Regular Contributor

You won't be able to use the copy mode as that uses the globalid, which wouldn't be created until the survey is submitted, so you can't grab that from the survey.

You would need to know which fields you want to be prefilled and would specify them in your URL. For example, https://survey123.arcgis.com/share/3e735764195c4cfa8ac9a385cfdxxxxx?field:name={name}&field:city={ci...}

- Jen
0 Kudos
by Anonymous User
Not applicable

Hi Heather, 

I asked a similar questions.. basically I have a survey for road inspections and the inspector has to select their name every time. I was hoping to have it grab from the previous survey but apparently it just isn't an option in survery123 yet. The people who responded to me gave me some work-around solutions but they did not work as I would have liked. Maybe they will for you. 

https://community.esri.com/t5/arcgis-survey123-questions/remember-last-entry-option-in-survey123/m-p...

0 Kudos
HeatherAdams1983
New Contributor II

Hi Jen,

I tested it without creating a link in the thank you screen, just using this URL in the same browser after I had submitted one survey:

https://survey123.arcgis.com/share/8a94db150fe443e294c6a7b48c27e9a4?field:Question2={Question2}

It didn't prepopulate Question2, it enabled me to submit it without an answer, even though it was a required question. In the data the value in the Question2 to field was {Question2}. Sorry I'm probably doing something really obvious wrong. Thanks for your help

0 Kudos
JenniferAcunto
Esri Regular Contributor

You need to build that into your survey so that the survey calls that variable for you. The link you would actually get would have the actual value passed from the survey and not the variable. 

Web Form URLs 

- Jen
0 Kudos
durus5995
New Contributor II

Have you taken a look at the pulldata("@layer") calculations yet?  There was a couple ways to query a layer and get values for fields.  I just started playing around with it.

https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-pulldata-quot-laye...

0 Kudos