Creating variable from a multiselect question linked question

Dear SuSo Forum Members,

I hope this message finds you well. I’m seeking guidance on creating variables for each household member selected in a linked multiselect question to use as substitutions in a follow-up question.

Here are the details:

  1. I have a household member roster called “memberRoster,” which lists household members and their demographic characteristics.
  2. In a different roster (land roster), there’s a question (Sec3_Q10) that asks, “Who in the household has a use or ownership right to this parcel?” This is a multiselect question linked to the household roster, allowing up to three responses.
  3. A follow-up question (Sec3_Q11) asks about tenure security for each member listed in Q10.

I would like to create variables for each holder’s name, such as:

  • Name_Holder1 for Sec3_Q10[0]
  • Name_Holder2 for Sec3_Q10[1] (if more than one response)
  • Name_Holder3 for Sec3_Q10[2] (if more than two responses)

These names will be used as substitutions in the follow-up question, for example: “21a. On a scale from 1 to 5, where 1 is not at all likely and 5 is extremely likely, how likely is [%Name_Holder1%] to involuntarily lose ownership or use rights to this %rostertitle% in the next 5 years?”

Thank you in advance for your support!

Best regards,
Asmelash

I have tried the following syntax for the first holder name Sec3_Q10.Length >= 1 ? memberRoster[Sec3_Q10[0]].Name : " " but still getting error “identifier expected”