Adding a table to a text entry question | XM Community
Skip to main content

Hi,

I have used matrix table to add a table to my survey but I would like to allow participants to add rows rather than giving them a fixed number of rows. Is there a way to achieve this?
Screenshot 2022-10-18 at 11.44.45.png
Many thanks in advance

Hello Simin ,
There can be 2 approaches here easy and hard;
Hard:
Include a JavaScript to create table and insert add row and delete row functionality but adding rows, using JavaScript, will not capture the data in Qualtrics automatically, we need to use set embedded data or hidden Qualtrics text fields to get the data captured.
Easy:
We can ask the user to enter(open text with number and range (0-max number of drugs user can enter) validation). Now, based on this question answer, we can add display logic at option level i.e (option 1 will have no display logic), option 2 will have display logic- to show if open text has answer '2' or greater or equal to two, similarly option 3 will have logic- to show if open text has answer '3' or greater than or equal to three.
The only catch here is it would require a page break in between the question and actual matrix and you would need to add validation for the text entry to not be more than what you think is max drugs user can enter. To make it on one page a JavaScript of hide and show should also work.
Alternatively, you can use side by side question as well for bigger text boxes and refer this thread for more: Side-by-side matrix with 10 rows - can I show rows only on demand using a button? — Qualtrics Community
Hope it helps!


Leave a Reply