Pre-selecting a response

Hi all,

We have a list of 150 cities in the ‘choices’ tab. Each are numbered 1-150.

On the survey, we have 50+ questions - starting with a question asking respondents to select their city.

Is there anyway to have the city answer pre-filled, by adding a field into the URL? I remember using the [parameters] function for this, but can’t seem to find a previous example.

Any ideas gratefully received!

Thanks!

@AndrewXLS, you could do it as outlined in the post discussed previously:

Thanks! But this doesn’t seem to work for select_one questions? Only freetext?

Hi @AndrewXLS, are you not able to do this in the XLSForm itself? Something like the following:

survey

type name label default
select_one cities city Select a city vancouver

choices

list_name name label
cities vancouver Vancouver
cities toronto Toronto

Hi Josh,

Yup, that’s exactly how it’s setup! But, would be useful for us to be able to send a pre-loaded survey to some people. For example, if they live in Vancouver:

https://ee.humanitarianresponse.info/x/xxxxxxxx?d[city]=vancouver

Would bump them automatically to the next relevant question, or at least pre-select it.

Any thoughts would be fantastic!

Hi @AndrewXLS, I tried this on a simple form and seems to work without an issue…

survey

type name label
select_one cities city Choose a city

choices

list_name name label
cities vancouver Vancouver
cities toronto Toronto

You can see it in action here:

https://ee.humanitarianresponse.info/Ckkpmmj1?d[city]=vancouver

Note that if you have the select_one question within a group, you need to specify the full path to that question, i.e.: d[group_name/city]=vancouver

1 Like

This works perfectly, thank you!

2 Likes