Get label instead value select_one ODK-X

Hi colleagues.

I am wondering if there is any way of getting the label instead of value from a select_one in ODK-X. The only way I think of now is to have a lot of if else statements and assign but for a long select_one dropdown this will be certainly time consuming. If anyone has a better way I would appreciate.

Hi @cmuchuchuti! Can you share a bit more about the problem? Do you mean you want to use the label rather than the value in the if statement? Or record the value rather than the label? You can always use the label as the value and then they are the same.

Thanks @elmps2018 for the response. I want to use the selected label as the instance name or refer to the actual label in the display.text of another question. I have an active survey already with live data so I didn’t want the option of change my value list which are currently integers.

You can used the odkData object to get information about the choices. These functions look like they might be helpful

1 Like