One-time passcode

One-time passcode verifies that a survey taker has not already submitted this survey. You select a text field as the Duplicate Check Field, and use the Introduction text to ask the survey taker to enter some information in the field. For example, for Anonymous surveys, you might ask a survey taker to enter a transaction code that identifies their experience with your company. The survey taker's answer is compared to the previously-entered values you specified for the Duplicate Check field, and if a match is found, Experience Cloud gives Duplicate code (m__duplicate_code) field a value.

One-time passcode used to validate a receipt code.

Warning: When using One-time passcode:
  • Add a page always including the display logic Duplicate code is present (m__duplicate_code is present).

  • Select Use for Duplicate checking on Feedback fields.

Note that only Feedback fields are supported.
One-time passcode persists across all different versions of the same survey.

For more information, see Survey content.

Advanced settings

You can configure these properties on the Advanced tab:

Duplicate code condition
The condition that must be met for a duplicate-code check to occur. The default value is Yes (always check). You might set this based on an answer to a different question. For example, My alternative question = Yes (q_my_alternativequestion = 1).
Duplicate code calculation
JavaScript code that assembles a value to check against the value stored in the database. When this script returns null, or this property is undefined, the survey taker's response to the question is compared with the values in the database. Otherwise, the value returned by this script is compared to the database.
Enable case insensitivity
When checked, case is not considered when matching the survey taker's entry with the Duplicate Check Field values. By default, answers are case sensitive.
Check the field only when submitting the survey
When checked, Experience Cloud compares the survey taker's One-time passcode answer to the Duplicate Check field values only when the survey taker completes the survey. By default, Experience Cloud does this comparison on every page.

Add duplicate checking for an anonymous survey URL parameter

One-time passcode nodes can be used to check for duplicate survey responses based on a parameter in an anonymous survey URL. This is considered a non-standard implementation, as one-time passcodes typically rely on a survey respondent's input for deduplication.

When using a one-time passcode to deduplicate with a URL parameter, the duplicate check is performed when the respondent attempts to navigate to the second page of a survey. The first page will always be visible when the survey is initially loaded, but if the parameter was already used for a previously completed survey, this method prevents the respondent from navigating to the next page or submitting the survey.

  1. Add the parameter and map it to a feedback field (Q-field). For more information, see Create and manage parameters.

    Note: A parameter must map to a feedback field (Q-field) to be used with a one-time passcode.
  2. On the first survey page, add a one-time passcode node. For more information, see Add and manage content.

  3. In the Introduction Text or Duplicate Check Field box, type the name of the feedback field (Q-field) the parameter maps to, and select the field from the options that pop up. Both boxes are immediately populated with the field and locked.

  4. Navigate to the one-time passcode node's Advanced settings.

    1. Enable Check code for finished survey only to ignore incomplete surveys for deduplication.

    2. Change the Display when option to Only if... and add the following condition.

      SCRIPT('if (fields.get(\"m__finish_date\")==null) { false } else { true }')
      Important: Use a text editor to write and validate conditions, then copy and paste them into the Rule definition box. Do not attempt to build them with the GUI, as the box will attempt to auto-fill as you type, but this solution uses internal survey fields that do not appear in the GUI.
    3. Add the following post-condition.

      fields.get('m__duplicate_code') == null
    4. Optionally, to make an exception for certain values, or to bypass the duplicate check if the parameter is null, add a condition to the Duplicate Code Condition textbox.

  5. Add a text or HTML block under the one-time passcode node for content to be displayed when the survey is identified as a duplicate. Consider using HTML or a custom style to make it stand out for the respondent.

  6. Change the Display when option to Only if... and add the following condition.

    m__duplicate_code present
  7. Optionally, to hide other text or questions on the page when a duplicate is identified, add the following condition to all nodes to be hidden.

    m__duplicate_code missing