Assigning a dynamic default value to a text-type question

I want to assign a default value for text-type question . Is that possible? . Like if I select one from the select_one question type then it must come as default value to the text type question . I have tried using ${},but that does not work . I have read the same question in Assigning a "dynamic" default value to a text-type question but the question was asked long back and i want to know if there is any update regarding it .

Thanks and Regards,

SGSC

You can print the value of a select_one in the label or hint of the following question by using the parens syntax (${my_select_one_var}).

You cannot store that value as a default response because the default column only allows static values (e.g., 5 is allowed, but ${my_number} is not).

What high-level problem are you trying to solve? Why do you need this ability?

Take a case . I am selecting one option from a list of options for example I have a select_one type of question , Which fruit you like the most? and i have given a list of options like Mango , Banana , Pineapple . He selects one option from it , and i want to display it as read-only text field in the next page . So can it be possible .

Thanks and Regards,

SGSC

Hi SGSC,

if you gone to store the text to read_only textbox you don't have to use textbox
you can use "note".

because you wouldn't any interaction from the user.

and "note" accept the formula of ${ }

Best Regards

This is a little trickier than it looks. If you just do ${my_select} you will only get the name/value. If you want to get the label of the select, you have to use jr:choice-name. And if you use jr:choice-name, you need to check to make sure the string isn't empty.

It'll end up looking like this...

survey

choices
image

output

form
fruit.xlsx (10.5 KB)

Hi,

Can we use this for select_multiple as well?

Thanks

You can, @Aline_Kullu! Give it a try and if you have any questions please post a new topic.

Yes @Aline_Kullu . But checking for string not empty might be difficult as you have to write more number of checks . Any queries please post as a new topic , it might be helpful for the community .

Thanks and Regards,

SGSC.

i am getting total of 3 text type questions and then i wanted to insert that sum in to my database. How is it possible? as i already display the sum into choices of another select_one question. but it is not inserting value by writing ${sum} into name column of choices sheet, but displaying the value as a choice in select_one by writing ${sum} into label column of choices sheet.