The default value of a select_one autocomplete field not displayed

Hi all,

In my XLSForm I set a select_one with autocomplete displayed with a default value. All is well displayd

On the ODK Collect tool, the value is well selected when I scrool my long list but not displayed in the field :

How can I set the default value or configure the 'observateur' field to correct this ?

type				| name			| label			| appearance		| calculation				| default
------------------------------------------------------------------------------------------------------------------
calculate			| obs_id		|				|					| instance('obs_c')/root/item[label='P. Franck']/name
select_one obs_c	| observateur	| Observateur	| autocomplete		|							| ${obs_id}

Thanks a lot for your help !

Hi @cborotPNV

Were you able to solve your problem? If not please attach the xlsx form so that we can test it.

Maybe the documentation for dynamic "default" / pre-sets can help you, please:
https://docs.getodk.org/form-logic/#dynamic-defaults and https://docs.getodk.org/form-logic/#dynamic-defaults-from-form-data.

In Collect, the field at the top of the list is used only for filtering the list below it, it is not used to show the currently selected value. I believe that if you add the minimal appearance (so minimal autocomplete in the appearance column), you will get what you're looking for.

I did that but It doesn’t really meet my needs.

Can you describe your needs, please? The more context you can provide about what a data collector is doing when they see this field, what they need to be able to see to make the right decision, why you're setting a default, what's not working for you about minimal autocomplete, the more likely we'll be to provide helpful advice.

Tanks @LN, I did'nt take care, in your 1st message, of your solution. It effectively mets my needs.

1 Like