Surveys: Automated Survey Invitations


If I create a timestamp field, including hours, minutes, and days, can I create an automated survey invitation that will detect how many days it has been since the timestamp?

It's possible, but if you do this be aware that the server-side (PHP) datediff function always treats the 'today' keyword as being the first second of the day. If your timestamp value is at six pm (18:00:00), then an ASI checking the datediff on the same day as that timestamp will actually return a result of 0.75 days. On the next day, it will return 0.25 days, regardless of what time of day it is checked. On succeeding days it will return 1.25, 2.25, 3.25, etc.


If a survey has already been completed, will the scheduler still send out survey invitations?

There are a variety of reasons why survey invitations might be in the schedule to be sent even though a survey is already completed. The survey invite might have been both manually scheduled and automatically scheduled. The survey invite might have been scheduled but then the URL for the survey was sent to the participant directly. Regardless, the scheduler will not send out a survey invitation for an already completed survey.


How can I schedule a survey invitation to go out at a specific time?

You can use a form of scheduling that allows you to specify the next day, next Monday, etc. However, that form of scheduling will not allow you to specify a lapse of a certain number of days.


What mathematical operations can be used in the logic for Automated Survey Invitations?

+ Add

- Subtract

* Multiply

/ Divide


When are automated survey invitations sent out?

Automated Survey Invitations are survey invitations that are automatically scheduled for immediate or future sending when certain conditions are true.

Creating an automated survey invitation requires:

Composing an email message.

Specifying the conditions that will trigger an email to be scheduled.

Specifying how to schedule the triggered email (such as: immediately, after a delay, on a specific day).

NOTE: In previous versions, conditions that used the "today" variable would require extra effort to make sure they were checked every day, but REDCap now detects and checks those conditions daily. The conditions are checked every twelve hours. The specific times they are checked during the day vary from one instance of REDCap to the next and change over time.


How do variables included via piping interact with an automatic survey invitation?

Piped variables are included in a survey invitation ONLY at the point that the ASI determines that an invitation should be scheduled. If the invitation is scheduled to be sent in the future, and a piped variable is later changed before the scheduled invitation is sent, that change will NOT be included in the already scheduled invitation.


Do participants with partially completed surveys receive automated survey invitation reminders?

Yes, participants will continue to receive automated survey reminders if they have not completed the survey or they have a partially completed survey response.


What are Automated Survey Invitations?

For any survey in your REDCap project, you may define your conditions for Automated Survey Invitations that will be sent out for a specified survey. This is done on the Online Designer page. Automated survey invitations may be understood as a way to have invitations sent to your survey participants, but rather than sending or scheduling them manually via the Participant List, the invitations can be scheduled to be sent automatically (i.e. without a person sending the invitation) based upon specific conditions, such as if the participant completes another survey in your project or if certain data values for a record are fulfilled.

Below are some guidelines to keep in mind when creating automated survey invitations:

The 'today' variable should be used only in conjunction with datediff. Comparing 'today' to a date is unreliable.

It's good practice to set up a field that can be used to explicitly control whether or not any invitations should be scheduled for a record. This allows for logic like the following:datediff([surgery_arm_2][surgery_date], 'today', 'd', true) = 6 and [enrollment_arm_1][prevent_surveys] != '1'

All fields in all forms on all arms are always available to the conditional logic of an ASI rule. If there is no value saved for that field, an empty string is used.


Can you base ASI on Calendar/Event dates?

No. The calendar scheduling system is completely separate from the survey invitation system. There is no ability to pipe or reference the data that displays on the calendar into the ASI logic.


What you can do is schedule the invitation using the same offset as the schedule uses.

You want your "Post Intervention Survey" invitation to be sent 2 days after the Baseline event. Provided you have a baseline date field you can set up an ASI in a couple of different ways (note that [no_invitations_flag(1)]='0' might be a checkbox you tick to mark a record as not having any automated invitations, you might look at a withdrawal status field as well/instead):

Logic: [no_invitations_flag(1)]='0' and [baseline_arm_1][baseline_date]!=''
When to send: after 2 days (ensure logic still true before sending)

Logic: [no_invitations_flag(1)]='0' and datediff([baseline_arm_1][baseline_date], "today","d", true) >= 2
When to send: Immediately


How often does REDCap check to see if Automated Survey Invitations (ASI) are ready to be scheduled?

Every time a record is created or modified (through the user interface or via data imports), it checks to see if an ASI invitation is ready to be scheduled. But for specific ASIs that have logic using the "datediff" function with either “today” or “now” (which means that the result of the ASI logic can change on its own from day to day), there is a cron job in REDCap that runs every 4 hours which will check these to see if an ASI invitation should be scheduled. Once the invitation is scheduled, a different cron job checks every minute to see if there are any survey invitations ready to send and sends them.


Do automated survey invitations preclude manual survey invitations?

Automated survey invitations do not preclude manual survey invitations or vice versa. An automated survey invitation will not be scheduled if an automated survey invitation has previously been scheduled, but if an automated survey invitation's logic is checked and found to be true, a survey invitation will be scheduled regardless of whether or not a survey invitation has been previously scheduled manually. Likewise, if an automated survey invitation has been scheduled, one can still schedule a survey invitation manually.


Is there any tool that can help me figure out how to set up ASI?

This link Survey Wizard: Automated Survey Invitations (ASIs) will take a user to a survey algorithm that was created by the Training Collaboration Committee using REDCap version 8.8.1. It addresses general ASI how-to with components and examples of different setups.


How do you stop survey reminders?

First, change the ASI so that no more reminders get scheduled. Then, one by one, delete the reminders from the Survey Invitation Log.
How can I use automated survey invitations to send invitations a specific number of days after a date given by a variable?

Suppose you want to send a follow-up survey seven days after surgery. You could define the condition of an automated survey invitation rule to detect that six days have passed since the surgery date and then schedule the survey invitation to be sent on the next day at noon. By checking for the sixth day instead of the seventh day, you gain the ability to set the specific time to send the invitation and you gain the opportunity to stop the sending of the invitation, if it turns out that you don't want to send it.

The conditional logic would look like: datediff([surgery_date], 'today','d',true) = 6

You could, instead, check that one day has passed and then set the invitation to be sent six days later, but you would lose the ability to set the specific time that the invitation is sent.