Now that we've explored the basic features of the online designer, let's explore some of the more advanced features. The first one that we're going to look at is branching logic.

You can add or modify branching logic in a field by clicking on the split green arrows. There are two ways to set up your branching logic. If you're comfortable with the syntax, you can type it out by hand using the advanced branching logic syntax box. There's also a link here that will take you to the branching logic section of the FAQ if you have any questions.

The other way is to use the drag-and-drop logic builder. You can also use this to get pieces of the advanced syntax that you can then modify later on. To use the drag-and-drop builder, you just find the answer choices you want to apply here. In REDCap, branching logic always goes in the child question, the question that you want to hide unless certain criteria are met. So for this question, I only want it to be seen if they answer "no" to the variable "like_picture," "Do you like the picture?" I scroll through the choices until I find it and just drag and drop over here. I can drag over as many different fields and answer choices as I like, and I can choose whether they have "and" logic, where all the items have to be true, or "or" logic where any of the items can be true. If I need a mix of and and or logic I can come up here to the advanced syntax and add in parentheses, change some of the ands to ors, whatever I need to check.

REDCap will also let you check your logic with a specific record. So I can go in here, select a record, and it will tell me if the logic evaluates to true or false. If you're typing your own advanced logic, it will also tell you whether or not the logic is valid or if you have an error someplace.

Next we're going to look at piping. Piping is a way of including the data that has been entered in one question in another question or in something like a survey invitation. Here I want to pipe whatever was entered in the variable "genre" into the field label of the variable how_much. To do that, all I have to do is include the variable name that I want to appear in there and put it in brackets. Once I've done that when I do data entry, whatever I answer in question genre will appear as part of the question "How much do you like said genre?"

Next we'll look at matrix fields. A matrix is a way of doing a collection of multiple choice questions, where all the questions use the same set of answer choices. You add a matrix by clicking "Add matrix of fields," or you can edit them by simply clicking on the edit button. When setting up a matrix you're still using the field label and the variable name. It's just instead of doing each individual in different fields, using a different popup box each time, you're entering them all at once. Similarly, you only have to do one set of answer choices for all the different variables. You don't have to put a label on each of the choices, either. You can leave them blank where people can comfortably intuit what is meant there, or if you're working with a validated instrument that didn't put a label over every answer choice. You can have them answer a single answer per row, radio buttons, or you can allow multiple answers per row. If you're using radio buttons, you can also allow ranking. This means that per column, only one answer choice can be selected. Finally, you have to give your matrix a group name, so that the background program in REDCap knows all of these go together.

Down here we have a calculated field. In calculated fields, you can perform calculations on hard numbers, 3+4, or you can pipe in variables from other places in the project and have REDCap do calculations based on those. Here I'm doing a calculation based on how many times I watch a movie in a week and how many times I watch television in a week. I simply put the variable names for those two fields in brackets, just like I did with the piping, and I can test it on different records. And it will let me know what the calculation looks like. If I modify it it will also let me know if I have a valid calculation in here, or if I have a syntax error that I'll need to change. As I start to type in the piping, it will also suggest fields based on what I have typed in. This helps you not have to remember every single variable name in your project. If you have any questions on how to format the equation, the "How do I format the equation" link will take you to the calculations section of the REDCap FAQ. For the most part, the equations are pretty similar to what you might use in Excel, but there are some places--such as sums or datediffs--that can be a little bit different. If you have any questions or your equation is not working, that's usually the first place to check.

Next I want to show you a couple of the action tags you can use in REDCap. Action tags are simply some additional customization that you can use on data entry forms. You put them in the field annotation box, which can also be used for including metadata about what exactly a field is for. To look at all the action tags available, you can click on the "Learn about action tags" button. There are a number of action tags already available in REDCap, and they're developing new ones all the time. Some of the most common ones are Hidden, where you can hide a field on page, or you can apply it specifically to a form, a survey, or when you're using the app. You can make something read only, capture the username of the person who entered it, capture the latitude or longitude of the data enterer, put in a placeholder value, mask a password, hide the today or now button, or capture the date and time of when the page was loaded. So here I'm using the @NOW button, and I'm also going to add the @TODAY. Now automatically whenever someone enters data on this page, the first time they come to do data entry the date and time will be captured.

Another very popular action tag is the @DEFAULT. @DEFAULT will allow you to have a value that will appear the field automatically but can be changed if the data enterer needs to. For example, if you're collecting medications at multiple visits, you could use the @DEFAULT tab so that the medications automatically fill in the exact same way they were the previous visit, and all the data enterer has to do is change the ones that have changed since then. Here, you can see I'm using it to pipe in the person's name. The setup is always the same: @DEFAULT= and then the value that you want to appear in quotation marks. If you have questions about the @DEFAULT, there is a great explanation of it in the "What are action tags?" section.

If you're wondering what your instrument will look like when you're done, you can check out the preview instrument feature. This will allow you to see what it will look like when data entry is done. It won't let you do calculations or branching logic, but it gives you an idea what it's shaping up to be. Do note that previewing the instrument is not the same as actually testing it; you should make sure you do both.

A good portion of your project setup is going to be done in the online designer, but you can also use the data dictionary. The data dictionary is like the programming way of looking at your REDCap project. To see it, you can just go to download the data dictionary, and here you can see more how REDCap actually looks at your database. You've got all the variable names in one column, and then it shows what form each one is on. Section headers are simply next to a variable name. It provides the field type, the field label. You can also do your branching logic in here. The data dictionary is often a faster way of setting up a large project. It's quicker to simply type out the information than it is to pop in and out of all the add fields and edit field boxes. However, even then it's often a good idea to do the first few items in the online designer, so that you've got a better sense of what it's supposed to look like in the data dictionary.

The data dictionary is also superior if you have to do several fields that are very similar. For example, if you need to have space for ten different medications in one form, it's often faster to do one in the online designer and then do the rest by simply copying-pasting and changing the number at the end in the data dictionary. Similarly, if you've got a calculation or a piece of branching logic that applies to a lot of fields, it's faster to come into the data dictionary, find the branching logic, and simply copy and paste it into all the fields that it applies to.

Finally, I'll show you have to set up repeating instruments for your project. This is very simple. You'll simply go to the project setup page and enable repeatable instruments in your project. You'll choose which instrument to enable, and then you can add a custom label for the repeating instruments if you need to. For example, I want the label for each of my favorite movie instances to be the movie name. So I can pipe that information in. And now when I go into a record that has repeating instruments I can see that it's piping the movie name in where the instance name would be. And that's the basics of how you create your project in REDCap. Next we're going to look at how you get your data out of REDCap using exports and reports and some of the statistics that REDCap will do for you.