Double-Entry Verification
Double-entry verification—also known as double data entry or dual data entry—is a data quality control process in which the same information is entered independently twice, and the two entries are then compared to identify discrepancies. Its purpose is to detect human transcription errors, particularly when data is captured from paper forms, scanned documents, handwritten notes, or other source records. Unlike ordinary validation, which checks whether a value is valid, double-entry verification checks whether it was entered accurately. For example, the value 27 passes a numeric validator even if the source document says 72.
A typical double-entry verification workflow includes two validation layers:
Assisted confirmation
Email and confirm email are compared with a client-side expression validator. 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. See Validator Notification Types.Selective dual entry
Critical fields are entered again on the second page and compared asynchronously in theonServerValidateQuestionsevent, which can return a custom validation message for each field.
How This Demo Works
First entry
Enter the participant ID, weight, height, date of birth, and email, or click Fill Sample Data.Assisted check
Confirm the email address. An expression validator checks that both email fields match.Second entry
Re-enter the critical fields without seeing the first-entry values, or click Fill Sample Data.Server-side comparison
When you complete the form,onServerValidateQuestionscompares the paired values and reports mismatches as field-level errors.
Connect to an API Endpoint
In regulated environments, a second operator often compares their entries with the first operator's saved submission on the server. To implement this workflow, call your comparison endpoint in onServerValidateQuestions, populate the errors object, and then call complete():
function validateDoubleEntryAsync(sender, { data, errors, complete }) {
fetch("/api/validation/double-entry", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
// Prefer sender.data so first-entry values are available when only page 2 is validated
participantId: sender.data.participantId,
participantId2: data.participantId2,
weightKg: sender.data.weightKg,
weightKg2: data.weightKg2
// ...other paired fields
})
})
.then((response) => response.json())
.then((result) => {
// result.errors: { weightKg2: "Mismatch with first entry..." }
Object.keys(result.errors || {}).forEach((name) => {
errors[name] = result.errors[name];
});
complete();
})
.catch(() => {
errors["weightKg2"] = "Comparison service is temporarily unavailable. Try again.";
complete();
});
}
survey.onServerValidateQuestions.add(validateDoubleEntryAsync);