Automatically fill a response based on the response from a previous question

Helo team,

I have a question that ask enumerator to select the name of their supervisor (‘A’ or ‘B’), then I am looking to autofill following question to be automatically filled by district ‘y’ if selected supervisor = ‘A’ or district ‘x’ if selected supervisor = ‘B’.
Thanks

You could do it as outlined in the image shared below:

In the survey tab of your xlsform:

Picture 1

In the choices tab of your xlsform:

Picture 2

Data entry screen as seen in Enketo: selected Supervisor A when selected District 1

Data entry screen as seen in Enketo: selected Supervisor A when selected District 2

Data entry screen as seen in Enketo: selected Supervisor B when selected District 3

Data entry screen as seen in Enketo: selected Supervisor B when selected District 4

Reference xlsform:

auto-fill.xlsx (10.7 KB)

1 Like

Hi Kal_lam
Thanks for the reply, I tried it out but it isnt working as it requires three arguments. From the example you have provided it seems line you have 4 districts (2 for each supervisor) while for my case I have two districts (one for each supervisors), i.e. district 1 = Supervisor A and district 2 = supervisor B.

Thanks,

You will need to have a closer look to understand the concept. Maybe an easier approach would be if you use the cascading select which should also very much solve your issue. To learn more on cascading select please feel free to go through our support article Adding Cascading Select Questions.

Thanks, I will opt for filter choice.

1 Like

Dear @Kal_Lam,
In case the H1 is the multiple selections, how could we deal with it?
ie: H1 selected codes 1 & 2 but H2 must auto select code 1 "How can I deal with it’?

Thank with regards,

Welcome to the community, @cmtr! Here instead of using ${H1}='1' you will need to use selected(${H1}, '1').

Customer Satisfaction Project - Test.xls (68.5 KB)
Dear @Kal_Lam
Could you please kindly help to correct the attachment file?
Best Regards,

Hola! usé esta alternativa y en Enketo funciona bien, pero al llenar el formulario con la app KoboCollect no funciona. Se debe a algún posible error de confección o no es viable en los dispositivos móviles?
Gracias de antemano