In my XLS Form questionnaire, I wanted to reference the text of the answer to a single-choice question. When I use the format ${name of the question to reference}, the name is displayed instead of the label of the question.
Welcome to the community, @Jerko2023! This post discussed previously should help you solve your issue:
You can use jr:choice-name()
to get the label displayed for a select_one
or select_multiple
Be care of the syntax, as it is a bit unusual:
Note
You have to wrap the
select_question
reference in quotes.‘${question_name}’
Thank you for your feedback. I followed the link to learn more about the ‘jr:choice-name’ function. I also saw how to retrieve the label with a multiple-choice question. In my case, I wanted to reference a single-choice question (Q1). To achieve this, I created a ‘calculate’ question (q0), and in the ‘calculation’ column, I entered the following formula: jr:choice-name(${Q1},‘${Q1}’).
Then, I simply referenced the q0 question using ${q0} in the label of the question where I wanted to include the reference.
Best regards.