Dynamic Appearance Change based on previous response

1. What is the issue? Please be detailed.
I would like to have the appearance of a question to be changed depending on the answer to a previous question.

2. What steps can we take to reproduce this issue?
Upload the files XLSForm with media files and notice in ODK Collect how the note does show that the text in the calculate field changes depending on the response to Q1, however, this doesn't dynamically change the appearance for Q2.

3. What have you tried to fix the issue?
Putting the actual text 'columns-2 no-buttons' instead of the ${calc_appearance} into the appearance field text in from the calculate field, but this is static and not what I want.

4. Upload any forms or screenshots you can share publicly below.
selects_example.xlsx (19.9 KB)
Selects_media.zip (3.3 MB)

I tried a similar thing with the parameters field and got an error when trying to upload the XLSForm to Central:

"The XLSForm could not be converted: Expecting parameters to be in the form of 'parameter1=value parameter2=value'."

selects_example_w_param.xlsx (20.3 KB)

Nope, you cant do this as appearances are evaluated as static strings when rendering the form.

I would like to have the appearance of a question to be changed depending on the answer to a previous question.

What you can possibly do is have two versions of the question - one with each desired appearance - and flip between them with a suitable relevant expression (based on the previous question) to ensure only one is ever shown.

1 Like