How to show the text answer of questions in the roster

Dear Team,

I would like to know how I can show the answer of the questions in the roster, outside of the roster.

If it is not in roster, we can do that by using %variable%, but when the question is in roster, it is not possible (it will say something like “you can not use substitution from deeper roster”).

I also know that we can refer to the answer in the roster by something like .roster[1].variable, but still I can not show the answer itself.

Is there any way to do that?

I appreciate your help.

Hello Kazusa and welcome to the forum!

Outside of the roster assign the expression to a string variable:

s=roster[1].variable

then include the %s% into the text of your question.

Unfortunately, substitutions work only for variables and questions (not all types, see details here: https://support.mysurvey.solutions/questionnaire-designer/limits/design-limitations-by-question-type/), but not for expressions, which is probably what you have tried.

Best, Sergiy Radyakin

Hi, Sergiy,

Thank you very much for your quick response!
This works great.
But then in the normal circumstance where I do not know the length of the roster, how can I show all the answers in the roster?

Now in my mind I have the imaginary code something like this;

i in 1:length(roster) {
s[i] <- roster[i].variable
paste(s[i])
}

Could we do something like this?

Thank you!

Kazusa, please explain what are you trying to achieve conceptually, and if you have a paper prototype of the questionnaire, show how it looks like there. Best, Sergiy