Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Click the blue “edit” link above the question you wish to validate

  2. Open the gray drop-down panel labeled “Validation”

    Image RemovedImage Added
  3. Click the + symbol to add a new validator, and select the type. The different types of validators and their requirements will be reviewed below

  4. After completing the validator, click “OK”

...

If you wish to add a custom error message, do so in the “Display” field. If nothing is entered into the “Display” field, the automatic error message that appears will read “Please enter at least [minimum] and no more than [maximum] characters.”

...

Expression

An expression is a piece of logic that dictates the parameters for an acceptable response. An example of an expression might be:

Code Block
{question3} > {question1} AND {question3} < {question2}

Now, let’s unpack what this means. Suppose the questions in this survey are asking about the minimum goal (question1), maximum goal (question2), and an achievable goal (question3) for the number of steps a participant takes in a day. If question 3 is meant to be between the values of questions 1 and 2, we need a way to ensure that participants don’t enter a value less than their minimum or greater than their maximum. We could use a numeric validator…except the the upper and lower bounds will be different for each participant. As such, an expression validator is the way to go.

There are two ways to create an expression validator: with the in-question builder tool, or by manually writing it out. For either way, the first thing you’ll need to do is click on the gray panel that says “Expression is empty”:

...

We will review how to use the builder first. Select the question you are working on for the first drop-down. Then, select your operator and type in the value. Since we want to use the value of another question’s answer as the lower limit here, put the Question ID of that question in curly brackets (e.g., {question1}:

...

As you can see, the expression is starting to auto-populate into the gray panel. Next, click the blue “Add condition” button to configure your upper limit:

...

From here, you can click OK and move on to testing your validator. However, for our purposes, we are going to click the gray “Edit” button to look at the manually-typed expression:

...

Note

Please note that the single quotes included in the expression above are more important for text answers, but will not interfere with numeric values

The custom error message is perhaps more important for expression validators than any other type. The reason for this is the the default error message looks like this:

...

While this error message is accurate, it might confuse participants. So make sure to add a custom message in the “Display” field, pictured in the first image of this section.

...

Regex

...

Email

An email validator is a shortcut around writing an expression to require the elements of an email address be included in the response. The email validator requires that the response be one word (no spaces), and that it contain both an @ symbol and a .com, .net, .edu, etc. It does not, however, validate that the email or domain name is active - for instance, entering fake@12345W2H.org will be accepted.

...