XLSForm Fun: How to display the 'label' of a selected answer, in the 'label' of another question!

October 7, 2018

XLSForms are super fun when you know how to hack them! A common request is to display the 'label' of an answer option in the 'label' of another question. XLSForm depends heavily on variables (aka the 'name' column), so it's super easy to display the 'name' in the label column. Unfortunately, sometimes clients prefer for their variables to be numbers or codes that aren't readable by the general public, hence the need to display the 'label' of an answer option instead of the variable. Here's a sample XLSForm I whipped up so we don't forget how to do this in the future. survey tab:

choices tab:

The result? On the confirmation screen, the 'label' of the color you selected will be displayed instead of the 'name.' So, instead of saying 'Can you confirm that your favorite color is 1?' it will say 'Can you confirm that your favorite color is Blue?' WINNING! Note: this is currently only supported by the SDK legacy app. Check out the XLSForm used in the example above here: https://docs.google.com/spreadsheets/d/1RkoA2uTulLfrdMkPSQIiUXFGh3n8OJTCYKKCUqtIk1g/edit?usp=sharing