Skip to content

Add Gmail/Outlook CSV contact import and export - #464

Merged
tomcardoso merged 2 commits into
mainfrom
feature/gmail-outlook-csv-import-export
Aug 2, 2026
Merged

Add Gmail/Outlook CSV contact import and export#464
tomcardoso merged 2 commits into
mainfrom
feature/gmail-outlook-csv-import-export

Conversation

@tomcardoso

@tomcardoso tomcardoso commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • CSV import now auto-detects Gmail's and Outlook's contact-export header shapes and remaps them onto Sourcerer's existing column vocabulary before the normal import logic runs. Plain Sourcerer-format CSVs are unaffected.
    • Gmail: supports both the current schema (First Name/Last Name, unprefixed Organization Name/Organization Title, numbered E-mail N - Value/Phone N - Value/Website N - Value) and an older export variant (Given Name/Family Name, Organization 1 - Name/Title). Verified against Google's own current contacts import template.
    • Outlook: First Name/Last Name, up to 3 emails, 6 phone types, Web Page + Personal Web Page. Verified against a real Outlook contacts export.
    • LinkedIn/X URLs found in generic website columns are routed to their own contact_links type instead of landing in "website".
  • Export gains two new formats, "Export as Gmail CSV" and "Export as Outlook CSV", available from both the All Contacts view and per-project export menus, alongside the existing CSV/Excel and vCard options.
    • Gmail export dynamically widens E-mail N - Value/Phone N - Value/Website N - Value to fit however many the widest contact in the export actually has — nothing is dropped, matching Google's genuinely unbounded numbered-column schema.
    • Outlook export fills all of Outlook's real fixed slots (3 emails, 6 phone types, 2 web pages) — the true ceiling of that schema, since Outlook has no expandable numbering scheme the way Gmail does.
  • After a CSV import, the result modal now notes any source columns that carried data but have no home in Sourcerer's contact model (e.g. physical addresses, spouse, custom fields) so nothing silently vanishes without the user knowing. Type/Label companion columns (e.g. Phone 1 - Type) are excluded from that note since they're just qualifiers on data that was imported.
  • Birthdays are normalized between ISO (YYYY-MM-DD), Google's year-unknown form (--MM-DD, discarded), and Outlook's M/D/YYYY.

Test plan

  • npm run typecheck passes
  • npm test passes (547 tests), including src/test/csv-format-detection.test.ts (Gmail/Outlook detection, both schema variants, dropped-field reporting, end-to-end import) and cases in src/test/export.test.ts (Gmail/Outlook export shape, dynamic widening, fixed Outlook slots)
  • Manual testing in the running dev app against real Gmail and Outlook contact export files

Closes #463

tomcardoso and others added 2 commits August 2, 2026 17:24
CSV import now auto-detects Gmail's and Outlook's contact-export header
shapes and remaps them onto Sourcerer's own columns before the existing
import logic runs. Export gains two new formats (alongside the native
CSV/Excel and vCard options) that write directly importable Gmail- and
Outlook-shaped CSVs, for both the All Contacts and per-project views.

Closes #463

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…mport fields

- Gmail CSV import mapping was wrong for the current real-world schema
  (First Name/Last Name + unprefixed Organization Name/Title, not the
  Given/Family Name + "Organization 1 -" variant originally assumed).
  Both variants are now supported, verified against Google's own current
  import template. Outlook import now also picks up "Personal Web Page".
- Gmail export now dynamically widens E-mail/Phone/Website columns to fit
  the widest contact in the batch, instead of a fixed 2-slot cap, matching
  Google's genuinely unbounded numbered-column schema.
- Outlook export now fills all of Outlook's real fixed slots (3 emails,
  6 phone types, 2 web pages) rather than an arbitrary 2-slot cap, since
  Outlook's schema has no room to expand beyond its named fields.
- Import now reports which source columns carried data but have no home
  in Sourcerer's contact model (addresses, spouse, custom fields, etc.),
  surfaced as a note in the post-import summary modal. Type/Label
  companion columns are excluded from the report since they're just
  qualifiers on data that was imported, not distinct dropped information.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@tomcardoso
tomcardoso merged commit b950a19 into main Aug 2, 2026
1 check passed
@tomcardoso
tomcardoso deleted the feature/gmail-outlook-csv-import-export branch August 2, 2026 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Outlook and Gmail CSV contact export/import

1 participant