Parent Deduplication
The deduplication system ensures that each parent or guardian has only one record in the system, regardless of how many children they have or how many forms they submit. This is achieved through email-based matching within each school.
How Deduplication Works
When a new parent needs to be created (from a form submission, import, or manual entry), the system follows a find-or-create process:
- Extract the email from the parent data.
- Search for an existing parent record with the same email within the current school (kindergarten).
- If found -- Return the existing parent record. No new record is created.
- If not found -- Create a new parent record with the provided details.
This process is handled by the ParentService::findOrCreate() method.
Deduplication Key
The deduplication key is the combination of:
- Email address (primary identifier)
- School ID (kindergarten scope)
This means:
- Two parents with the same email in the same school are treated as the same person.
- Two parents with the same email in different schools are separate records (each school has its own data space).
TIP
Email is the deduplication key because it is the most reliable unique identifier for parents. Names can be spelled differently, phone numbers can change, but email addresses tend to be stable and unique per person.
When Deduplication Triggers
Form Submissions
The most common deduplication scenario. When a family submits an admissions form:
- The form includes parent/guardian email fields.
- The system calls
findOrCreate()for each parent. - If the parent already exists (e.g., from a previous submission for a sibling), the existing record is linked to the new lead.
- If this is a new parent, a record is created.
Data Imports
When importing leads from CSV/XLSX:
- Each row's parent email is checked against existing records.
- Matching parents are linked rather than duplicated.
- New parents are created for unmatched emails.
Manual Entry
When staff manually adds parent information to a lead:
- The system checks if a parent with that email already exists.
- If so, it links the existing parent.
- If not, it creates a new record.
What Happens to Existing Data
When an existing parent is found and linked to a new lead:
- The parent record is not modified -- existing contact details remain unchanged.
- A new family member link is created connecting the parent to the new lead.
- The parent's information is shown on the new lead's profile.
WARNING
The system does not automatically update parent details when a new form submission contains different information for the same email. For example, if a parent submits a form with an updated phone number, the existing parent record retains the original phone number. The new data is preserved in the form submission's raw JSON for reference.
Handling Deduplication Edge Cases
Same Email, Different Names
If a parent submits forms with slightly different name spellings (e.g., "Jane Smith" and "J. Smith"), the system:
- Matches on email and uses the existing record.
- Does not update the name on the existing record.
- Staff can manually update the canonical name if needed.
No Email Provided
If a parent record has no email:
- Deduplication cannot be performed.
- A new parent record is created.
- These records may need manual review and merging.
Shared Email Addresses
If two different parents share the same email address (uncommon but possible):
- The system treats them as the same person.
- This is a known limitation. If discovered, staff should assign distinct emails.
Reviewing Potential Duplicates
Despite the automated deduplication, some duplicates may occur (e.g., when parents use different email addresses). To identify potential duplicates:
- Look for parents with the same name but different email addresses.
- Check leads with multiple parent records that may represent the same person.
- Review the parent list for similar names or partial matches.
Merging Parent Records
If duplicate parent records are discovered:
- Identify which record should be the primary (canonical) record.
- Update family member links to point to the primary record.
- Transfer any unique information from the duplicate to the primary.
- The duplicate record can then be safely removed.
TIP
When in doubt, keep the record that has the most complete and up-to-date information as the primary.