/
Check for Specific Email Domain on REDCap Survey

Check for Specific Email Domain on REDCap Survey

Purpose: Demonstrate how to use the “right” function to check for an @wustl.edu email address which can be used in branching logic, survey queue logic, etc. This can be adapted to any email domain. 

Practical Examples:

  1. Using Branching Logic to have non-university employees enter a guest ID

  2. Allowing only people from WashU to submit an application

For more information about the “right” function, see REDCap Functions to use with Text values on the REDCap Special Function Explanations page.


Demonstration Video:


Practical Examples:

  1. Using Branching Logic to have non-university employees enter a guest ID

  2. Allowing only people from WashU to submit an application

 

Using Branching Logic to have non-university employees enter a guest ID

  1. Click the Branching Logic icon on the field you would like to appear if the email is an @wustl.edu email.

  2. Click in the Advanced Branching Logic Syntax box and enter an equation with the “right” function so that REDCap checks if the final 10 characters of the email address entered to the field are equal to @wustl.edu and click Save. For example, if the variable name of the email field is [email], the formula will be: right([email],10) = '@wustl.edu'

image-20240723-182314.png
  1. Create a record and enter an @wustl.edu email address into the field to confirm the field with the Branching Logic appears (note: you may need to remove your cursor from the field after typing the address for the hidden field to appear):

image-20240723-182628.png
  1. Then enter a non @wustl.edu address to confirm that the field hidden by Branching Logic does not appear:

 

image-20240723-182724.png

To check for a non @wustl.edu email using Branching Logic:

  1. Click the Branching Logic icon on the field you would like to appear if the email is not an @wustl.edu email.

  2. Click in the Advanced Branching Logic Syntax box and enter an equation with the “right” function so that REDCap checks if the final 10 characters of the email address entered to the field are equal to @wustl.edu and click Save. For example, if the variable name of the email field is [email], the formula will be: [email] <> '' AND right([email],10) <> '@wustl.edu'

image-20240723-183114.png

The [email] <> '' portion of the formula is stating that the field will only appear if the email address field is not blank. Technically, when the email field is blank, the field does not have an @wustl.edu email in it and the Non-WUSTL email message field will appear if the field is blank. By adding the additional portion of the formula, we ensure the message does not appear until there is an email address in the field that is not an @wustl.edu address.

  1. Create a record and enter a non @wustl.edu email address into the field to confirm the field with the Branching Logic appears (note: you may need to remove your cursor from the field after typing the address for the hidden field to appear):

image-20240723-183546.png
  1. Then enter a @wustl.edu address to confirm that the Non-WUSTL email field hidden by Branching Logic does not appear:

image-20240723-183654.png

 

Related content

Create a Re-Enter Email Address for REDCap Survey
Create a Re-Enter Email Address for REDCap Survey
More like this
20240717 - Sending Survey Invitations via email from Guest WashU REDCap Accounts
20240717 - Sending Survey Invitations via email from Guest WashU REDCap Accounts
More like this
Sending Email Invitations from Guest Wash U REDCap Accounts
Sending Email Invitations from Guest Wash U REDCap Accounts
More like this
Add no-reply@wustl.edu as a secondary email and always add the external user’s institutional email as a cc or bcc
Add no-reply@wustl.edu as a secondary email and always add the external user’s institutional email as a cc or bcc
More like this
REDCap - Designate an email field for communication
REDCap - Designate an email field for communication
More like this
Create REDCap e-Consent Project
Create REDCap e-Consent Project
More like this