I hope you are doing well. I am writing this to seek your advices for selected option in kobo.
Regarding to the following attachment , whenever I select the Village name , I want the Village code is selected and hide from the Form.
So do you mean you want this to happen in the background without any enumerator’s control (when selecting village name the village code should be auto-selected?
Yes, That’s correct. So, after the village name selected , The village code will automatic selected according to village Name this and the village code hidden from the form.
Thank you for your respond. I can add calculation , but if i have many row, are there any way, i could do faster. That’s would be help if you would give me an example .
It seems that this Code is just the XLSForm name of the choice item of the village select. So, it is visible directly if you export the data or view them in XML mode.
Could you explain more what exactly you want to get, please?
If you just want to have village choice label and name together, you could create a calculate type VillageCode with calculation as ${VillageSelect}. You would neither need here a select type nor a long if formula.
Another - design - option could be to add the code at the beginning of the village label: code VillageName. If you change your choice list like this you could re-deploy the form and get the code in the label for all villages, in view and export.
Thank you for kindly respond, I want to selected village and the village code is automatic select . I could try calculation but this will need to write a very long writing in calculation . I am not sure this is clear.
For example: I want to select village Sambour and Village code must auto pick up in the form.
Here is example with different options: Villages01.xlsx (13.1 KB)
I added notes, to show the calculated values. To keep leading zeros in choices names, you need to write them as string in Excel XLSForm, i.e. leading ', e.g. '06050301
I would like to underline again, that code and label are available by just switching between XML Headers and Values or Labels option. See examples for table view and export below. So I don’t understand well why you need to add an extra calculate variable.