I have a list of names that I'd like to ask the same question for, but for each person taking the survey this list of names will be different (i.e. some people will have n = 10, others might have n = 5 or n = 20). Is there a way to add n rows to my matrix question without hardcoding the number of rows? In other words, I want the number of rows in this question to be dynamic, according to how many names are in the list.
Thanks for the help!
Page 1 / 1
You have to add all rows and have to add display logic on each row so only required rows will appear for particular group.
Thanks for the fast response @bansalpeeyush29!
This doesn't quite address the issue though. I neglected to mention that this list will contain different names for each person as well. So hardcoding the list of names into the matrix doesn't quite work. Maybe the full story will help to answer my question:
- I have a .json file that is updated on a remote server that contains the lists of names as people are added to different conditions.
- The addOnload function goes and fetches this data, parses, and subsets it to get the right list of names for the given person (i already have this working).
- so I want each person to answer a question for every other person in their condition at the time that they take survey.
The optimal solution in my mind is to be able to add rows to the matrix using javascript for however many people are in the final list for that given condition.
This doesn't quite address the issue though. I neglected to mention that this list will contain different names for each person as well. So hardcoding the list of names into the matrix doesn't quite work. Maybe the full story will help to answer my question:
- I have a .json file that is updated on a remote server that contains the lists of names as people are added to different conditions.
- The addOnload function goes and fetches this data, parses, and subsets it to get the right list of names for the given person (i already have this working).
- so I want each person to answer a question for every other person in their condition at the time that they take survey.
The optimal solution in my mind is to be able to add rows to the matrix using javascript for however many people are in the final list for that given condition.
@JakeParelman,
Your matrix has to have the maximum number of possible rows. You can't add rows dynamically because Qualtrics won't know about them and won't record the answers on the back end.
You have two choices:
1. Include all the people and hide the ones you don't want a respondent to see with display logic or JavaScript. This may result in many data fields for the question, but will keep your data clean.
2. Include the maximum number of rows a respondent may see, and pipe the row labels from your input data. The issue with this is approach is the data fields will represent different people for different respondents so you will have to unwind the data.
Your matrix has to have the maximum number of possible rows. You can't add rows dynamically because Qualtrics won't know about them and won't record the answers on the back end.
You have two choices:
1. Include all the people and hide the ones you don't want a respondent to see with display logic or JavaScript. This may result in many data fields for the question, but will keep your data clean.
2. Include the maximum number of rows a respondent may see, and pipe the row labels from your input data. The issue with this is approach is the data fields will represent different people for different respondents so you will have to unwind the data.
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.