A date variable allows you to create, update, calculate and assign participant-specific dates to a their record. This can be useful for driving activities in the platform off of a specific date* such as an appointment date, or a smoking quit date. It can also be piped into messaging to a participant to let them know the specific date as well.
*For more information on how to schedule activities off of a date variable, check out the Event Blocks guide.
Setting up a date variable
Navigate to Manage Study > Variables
Click the “+ New Variable” button.
Give the variable a friendly name and a description.
If the variable should only be used in a specific arm, you can specify that arm. Otherwise, select “All arms” from the list.
Select “Date” as the type from the list.
The date can have an initial value that can calculate days from participant start. If you don’t want to have a default value, you can leave this blank.
Choose the format in which you would like the variable to display in messaging.
Click “Save Variable” button.
Setting and updating date variables using event logic
Navigate to Manage Study > Arms.
Choose the intervention arm and click “Manage Event Schedule”.
Depending on your study design, you will either build logic off of an existing event, such as an “Administer Survey” event, or you may schedule a new “Add Logic” event. In this example, we want to participant’s Quit Date variable to be updated based on the completion of a survey. Therefore we will build logic off of the “Set Your Quit Date” survey.
Click “Define Logic” from the survey event.
Define the criteria in the IF statement. In this example, the “Set Your Quit Date” survey is a single question survey. If the participant completes it, we want to modify the Quit Date variable.
Choose “Modify the participant’s date variable” action in the THEN statement.
Select the variable you want to set or change.
You can choose to set the date variable to be today’s date, another date variable, or any responses from the survey that are validated dates. In this case, we want to set the Quit Date variable to the CustomQuitDate response in the survey.
You can also add or subtract days from the today’s date, another date variable, or the survey response. If you do not need to offset the date (e.g. CustomQuitDate minus 7 days), then you can leave that dropdown blank and save.
In this case, we do not need the offset, so we’ll leave it blank. Remember to click “Save Logic” to save your changes.
Adding date variables in messaging
Follow Steps 1-5 in Setting and updating date variables using event logic above.
From the event logic screen, choose “Send a message” action in the THEN statement. Define the recipient and delivery method as well.
Type your message content.
Available variables will be listed below the content editor. You can copy and paste directly from there.
Be sure to click “Save Logic”.
If you did not set up the date variable with a default value in the variable configuration, be sure you’ve used the “Modify participant’s date variable” logic action prior to using it in messaging. Otherwise, no date will be available to display.