Accessibility Compliance
SurveyJS libraries meet a variety of WCAG and Section 508 standards. Run AXE® Validation to assess this demo’s accessibility level.

Detect Mis-Keyed Form Entries

Edit in →

Mis-keyed variation detection identifies values that likely refer to the same person or organization but contain typos, misspellings, or inconsistent formatting—for example, John Smth instead of John Smith, or ACME Corp instead of ACME Corporation. This feature is useful for detecting human data entry mistakes before they create duplicates or bad records in CRM contacts, clinical registrations, insurance claims, or research participant records.

To implement approximate string matching in SurveyJS, register a custom asynchronous function and add an async expression validator to a question's validators array.

How This Demo Works

  1. The form collects contact details (full name, date of birth, email, organization).
  2. Each field is assigned an async function that validates its value.
  3. The function compares the field value against the corresponding property in an in-demo contact list using string similarity (with a short delay to simulate async work).
  4. If a near match is found, the function returns false, and the field displays the validator text.

Try values like John Smth, Kathrine Brown, Sofia Martinezz, or ACME Corp.

In this demo, validators use "notificationType": "warning", so validation messages do not block form submission. To prevent the form from being submitted until the issue is resolved, use the default "error" notification type.

Validator Notification Types

Connect to an API Endpoint

Replace the demo helper with a fetch call (or an equivalent call using your SDK) to compare values against your CRM, patient registry, or matching service. Call this.returnResult(boolean) when validation completes:

function isNotMisKeyedName([fullName]) {
  if (!fullName) {
    this.returnResult(true);
    return;
  }
  fetch("/api/validation/miskeyed", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({ field: "fullName", value: fullName })
  })
    .then((response) => response.json())
    .then((data) => {
      // data.ok === true means no problematic near-match
      this.returnResult(!!data.ok);
    })
    .catch(() => {
      this.returnResult(false);
    });
}

registerFunction({
  name: "isNotMisKeyedName",
  func: isNotMisKeyedName,
  isAsync: true
});

Add expression validators to your survey JSON, for example: "expression": "isNotMisKeyedName({fullName})". Refer to the JSON schema in the Code tab for more examples.

Expression validators use a fixed text message. If your API needs to return a personalized message with a dynamically inserted value, such as "Did you mean John Smith?", use the onServerValidateQuestions event instead. See the Double-Entry Verification and Detect Duplicate Form Records demos for examples.

Your cookie settings

We use cookies to make your browsing experience more convenient and personal. Some cookies are essential, while others help us analyse traffic. Your personal data and cookies may be used for ad personalization. By clicking “Accept All”, you consent to the use of all cookies as described in our Terms of Use and Privacy Statement. You can manage your preferences in “Cookie settings.”

Your renewal subscription expires soon.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.

Your renewal subscription has expired.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.