Using embedded fields and the rich text editor along with branching logic, you can create a table to show rows and columns only when needed. Here's how:


Step 1. Create a Descriptive text field, enable the rich text editor and create your table with as many rows/columns needed.


Step 2. Create the fields needed that will be associated with the table’s cells. In this example, we want “First value” and “Second value” text to always show, so we simply add this text to the cells. The remaining cells will be populated with embedded fields to be displayed based on branching logic.

Step 3. Continue you build out the rest of your fields. In this example, we are creating Descriptive Text fields for “Third value”, “Fourth value”, etc. Additionally, we are creating Text Fields in which values will be entered.

Step 4. With all the necessary fields created, we can now embed them into the table. Notice we are embedding both the Descriptive and Text fields into the table in our “How many additional data points will you be entering” Descriptive text field. Here, we are simply adding the field names into the correct locations by enclosing them in {} brackets. Field embedding simply change where a filed is displayed on the form/survey.

Step 5. To show or hide these fields in the table, we need to create a field to build our branching logic off of. In our example, we are using a Drop Down List. Note, since we will be emedding these fields into our first field, the order of the fields doesn’t really matter, but we’ve added them in their correct, logical order so when data is exported they will show in the correct order.

Step 6. Next, it’s time build out our branching logic…

For our “Third value” we have:

[howmany]="1" OR [howmany]="2" OR [howmany]="3"

This will make the field visible if the participant selects 1, 2, or 3 additional data points for the howmany field.

For our “Fourth value”, we have:

[howmany]="2" OR [howmany]="3"

This will show the field if they respond with 2 or 3 additional data points.

For our “Fifth value” we have:

[howmany]="3"

This will only show the field if they choose to add 3 additional data points.

Notice the branching logic is the same for both the Descriptive Text and Text fields, because we only want to show those fields when needed.


Here's how it looks: Notice our first two fields are always displayed. It's not until we respond to the "How many additional data points will you be entering? "question that the additional fields show.


Here, we select to show 2 additional data points. Note the 2 additional fields now appear.

More information on using Embedded fields and Branching Logic can be found on the Help & FAQ page in REDCap

For additional assistance, please contact the REDCap Support Team

  • No labels