How to Dynamically Add Table Rows...?

22 views
Skip to first unread message

elda....@gmail.com

unread,
Sep 23, 2025, 1:16:26 PMSep 23
to Redcap Open
Hello REDCap experts, 

For a study, I have a form where patients need to list all the medications they are currently taking, along with some specific details. The data I need includes:

  1. Name of the medication

  2. Start date

  3. Whether it is provided by the public health service

  4. Whether it is ongoing

  5. If it is not ongoing, an end date

So, there are 5 variables.

I was thinking of building a table for this. Would it be possible to create a single row with these fields, and then have a button (e.g., a “+” button) that allows users to add another identical row below? This way, they could enter 15–20 medications if needed. It would save me a lot of time and avoid having to create a fixed table with 20–30 rows in advance.

Thanks!

Amit Tandon

unread,
Sep 23, 2025, 7:02:05 PMSep 23
to Redcap Open
One way that REDCap explicitly provides is the ability to use repeat instruments. You create a form consisting of these fields and then you can add as many as you want

el_ da

unread,
Sep 23, 2025, 8:10:21 PMSep 23
to Amit Tandon, Redcap Open
Thanks, I'm familiar with that method. I was hoping there was another way to clone all the fields and add rows within the same form—possibly even using an external module.
Thanks anyway for your help!

Elda


--
You received this message because you are subscribed to the Google Groups "Redcap Open" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redcap_open...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/redcap_open/cb569d71-4728-440a-9a9e-1c2004e5ecaan%40googlegroups.com.

Luke Stevens

unread,
Sep 23, 2025, 8:17:01 PMSep 23
to Amit Tandon, Redcap Open

As Amit suggests, you can put your five repeating fields on a separate form set to be repeating and you can add as many instances as you like. If you want to see a table of instance data on your main form then see if you can utilise the (my) “Instance Table” external module. You get something like this on your form (and add/edit instances in a popup window):

 

Alternatively, do it old-school and set up some number of similar fields in your form (v_1, v_2, v_3, …) and embed them in an HTML table – a descriptive text field per row is often easiest. Use a checkbox plus branching (or calctext dynamic styling) to have each new row appear. This method looks nice and clean to users, but is much more work to set up than a repeating form, and means your data is in a “wide” form with whatever maximum number of repeats you build in. You get this kind of thing though (here on a survey):

 

HTH,

Luke

Luke Stevens
Research Data Systems Manager
Clinical Epidemiology & Biostatistics Unit (CEBU)
Murdoch Children's Research Institute
The Royal Children's Hospital, 50 Flemington Road
Parkville, Victoria 3052 Australia
T   +61 3 9345 6552
E   luke.s...@mcri.edu.au
W  mcri.edu.au

 

 

From: redca...@googlegroups.com <redca...@googlegroups.com> On Behalf Of Amit Tandon
Sent: Wednesday, 24 September 2025 09:02
To: Redcap Open <redca...@googlegroups.com>
Subject: [REDCap Open] Re: How to Dynamically Add Table Rows...?

 

CAUTION:  External Email. Please be cautious with attachments and clicking links

 

--

You received this message because you are subscribed to the Google Groups "Redcap Open" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redcap_open...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/redcap_open/cb569d71-4728-440a-9a9e-1c2004e5ecaan%40googlegroups.com.



This e-mail and any attachments to it (the "Communication") are, unless otherwise stated, confidential, may contain copyright material and is for the use only of the intended recipient. If you receive the Communication in error, please notify the sender immediately by return e-mail, delete the Communication and the return e-mail, and do not read, copy, retransmit or otherwise deal with it. Any views expressed in the Communication are those of the individual sender only, unless expressly stated to be those of Murdoch Children’s Research Institute (MCRI) ABN 21 006 566 972 or any of its related entities. MCRI does not accept liability in connection with the integrity of or errors in the Communication, computer virus, data corruption, interference or delay arising from or in respect of the Communication.

Reply all
Reply to author
Forward
0 new messages