Click on the magnifying glass to the right. Starting typing a topic you wish to learn about

Piping

Initial Considerations

The Piping feature allows users to inject previously collected data into text on a data collection form or survey, thus providing greater precision and control over question wording. It can also be used in other ways, such as for customizing survey invitations (e.g. by including the respondent's name in the email) or survey acknowledgments (e.g. thanking your respondent by name after completing a survey).

Piping can be used in many different places in REDCap. Below is a list of all the places where Piping may be utilized to insert a data value *INTO* text.

  •  Field Label

  •  Field Note

  •  Section Header

  •  Matrix field column headers

  •  Option labels for multiple choice fields (radio or drop-down)

  •  Slider field labels (i.e. text displayed above slider bar)

  •  Survey Instructions

  •  Survey Acknowledgement Text

  •  Survey invitation emails (sent via Participant List or Automated Invitations) - includes both subject and message

  •  Custom text displayed at top of Survey Queue

The Process

The syntax for piping is similar to that used for branching logic or calculated fields.  To use piping, simply specify the variable name within two square brackets "[]" and include that variable into any text string at the locations specified above.  For example, your form might contain a field with a "patient"

  • Create variable that collects the patient's name similar to the following:

Variable: patient
What is the patient's name?

  • Next, to use the patient's actual name within the text of the next question specify a field label that embeds the variable name "patient" within square brackets similar to the following:


Variable: doctor
What is the name of [patient]'s doctor?

  • In the edit field dialog, the field label might look similar to the following:


The form inside of the online designer might look similar to the following:

  • As soon as a patient's name is entered, the field label that contains the piping variable will also display the value entered.  For example, during the data collection process via the "Add/Edit Records" page, data entry may look similar to the following:


Notice that the second field which contained a Field Label with Piping specified, now displays the actual value of the patent's name embedded within the question.

Examples using Piping

  • Some alternative uses of piping are illustrated below.  These examples can be easily used in your project by replacing the variable name with the one that exists in your form:

Additional Considerations

Piping is useful in Longitudinal Projects when you want to reference a participant’s demographic information in separate events.  You need to indicate where the information you want to pipe is located by using the variable name AND unique event name.  For example:

  • The variable name = “dob”

  • The variable is located in the “baseline” event (unique event name is “baseline_arm_1”)

  • Combine these two pieces: [unique event name][variable name]
    For example, [baseline_arm_1][dob]