Resume Auto-Fill Agent
Build an AI-powered Resume Auto-Fill Agent that extracts candidate information and automatically populates application forms.
Salesforce Developer

Author: Deeraj Kumar | Stack: LWC · Apex · Regex · JSZip
1. Abstract
Recruiters and HR teams often need to manually re-type candidate details from resumes into Salesforce records — a slow, repetitive, and error-prone task. The Resume Auto-Fill Agent is a custom Lightning Web Component paired with an Apex controller that lets a user upload a resume file (TXT, PDF, DOC, or DOCX), automatically extracts key candidate information, and pre-fills an editable form. After reviewing the parsed data, the recruiter clicks Save to create a Job_Applicant__c record directly in Salesforce.
Objective
- Eliminate manual data entry from resumes
- Support multiple file formats: TXT, PDF, DOC, DOCX
- Extract Name, Email, Phone, Skills, Experience, and Education
- Provide an editable preview before saving to Salesforce
- Persist data into the custom object Job_Applicant__c
Custom Object — Job_Applicant__c
| Field Label | API Name |
|---|---|
| Name (auto-generated) | Name |
| First Name | First_Name__c |
| Last Name | Last_Name__c |
| Email__c | |
| Phone | Phone__c |
| Skills | Skills__c |
| Education | Education__c |
| Years of Experience | Years_of_Experience__c (Number/Integer) |
2. Solution
2.1 Architecture Overview
The solution is split across three layers that move data from a raw resume file to a structured Salesforce record.
| Layer | Responsibility |
|---|---|
| LWC — resumeUploader | Upload UI and auto-fill form. Accepts .txt, .pdf, .doc, .docx. DOCX files are unzipped in-browser via JSZip static resource; word/document.xml stripped to plain text. All others sent to Apex as Base64. |
| Apex — ResumeParserController | parseResume() routes processing by file extension. Works on raw Base64 to avoid Blob.toString() UTF-8 errors on binary files. Regex extracts Name, Email, Phone, Skills, Experience, Education. PDF uses multi-strategy text-operator scanning (BT/ET, Tj, TJ blocks). |
| Data Layer | saveApplicant() maps reviewed form fields to Job_Applicant__c fields. Creates the record. Years_of_Experience__c stored as Integer. Toast notifications confirm success or surface errors. |
2.2 Field Mapping — Form to Salesforce
| Form Field | Salesforce Field (API Name) |
|---|---|
| First Name | First_Name__c |
| Last Name | Last_Name__c |
| Email__c | |
| Phone | Phone__c |
| Skills | Skills__c |
| Years of Experience | Years_of_Experience__c (Number) |
| Education | Education__c |
| First Name + Last Name | Name (auto-generated by Salesforce) |
2.3 File Format Handling
| Format | How It Is Processed |
|---|---|
| TXT | Read directly as plain text via FileReader API. Sent as Base64 to Apex, decoded, and Regex applied. |
| Sent as Base64. Apex uses multi-strategy text-operator scanning (BT/ET blocks, Tj operators, TJ arrays) to extract the text layer. Scanned/image PDFs without a text layer cannot be parsed. | |
| DOC | Best-effort parsing on the OLE2 binary format directly in Apex. Accuracy is lower than other formats. |
| DOCX | Unzipped in-browser using JSZip static resource. word/document.xml is extracted and stripped to plain text before being sent to Apex as a string. |
3. Step-by-Step Guide
3.1 Setup
- Download jszip.min.js and upload it under Salesforce Setup → Static Resources, naming it JSZip. This enables in-browser unzipping of .docx files.
- Create the custom object Job_Applicant__c with all fields listed in Section 1 (Name, First_Name__c, Last_Name__c, Email__c, Phone__c, Skills__c, Education__c, Years_of_Experience__c).
- Deploy the Apex class ResumeParserController with the parseResume() and saveApplicant() methods.
- Build and deploy the resumeUploader LWC with a file selector, a spinner, and the editable auto-fill form.
3.2 Using the Component
- Add the resumeUploader component to any Lightning page in App Builder. Save and Activate.
- Click the file upload button and select a resume in TXT, PDF, DOC, or DOCX format.
- For DOCX: the LWC loads JSZip from Static Resources, unzips the file in the browser, extracts word/document.xml, and strips it to plain text.
- For TXT, PDF, DOC: the file is read as Base64 via the FileReader API and passed to Apex.
- Apex parseResume() decodes the input by extension and runs Regex patterns to extract Name, Email, Phone, Skills, Years of Experience, and Education. The results are returned to the LWC.
- The parsed values populate the editable form. The recruiter can correct any field — for example, manually splitting a single-string name into First and Last Name.
- Click Save Applicant. The LWC calls saveApplicant() with the reviewed field values. Apex inserts the Job_Applicant__c record and returns the new Record Id. A success toast confirms creation and the form clears.
3.3 How the Apex Regex Extraction Works
ResumeParserController.parseResume() applies a set of Regex patterns in sequence to the plain-text content of the resume:
| Field | Regex Strategy |
|---|---|
Standard email pattern: [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,} | |
| Phone | Matches common number formats including country codes and separators |
| Name | Looks for capitalized words near the top of the document (first non-email, non-phone line) |
| Skills | Looks for a section heading containing 'skills' and extracts the following lines |
| Years of Experience | Looks for patterns like '3 years', '5+ years', 'X years of experience' |
| Education | Looks for a section heading containing 'education' and extracts degree and institution lines |
4. Conclusion
4.1 Summary
The Resume Auto-Fill Agent demonstrates a practical, low-cost automation that turns unstructured resume files into structured Salesforce records in seconds. It reduces manual data entry for recruiters while keeping a human-in-the-loop review step before any record is saved. The multi-format support (TXT, PDF, DOC, DOCX) covers the most common resume file types, and the browser-side DOCX unzipping avoids Apex file-size and binary-handling limitations.
4.2 Pros
- Reliable TXT and PDF (text-layer) parsing via Regex
- Robust DOCX support using browser-side JSZip — avoids Apex binary file limits
- Avoids Apex Blob.toString() UTF-8 crashes on binary files by working with Base64
- Editable preview keeps a human check before saving — no accidental data corruption
- Single click creates a Job_Applicant__c record with a success toast and auto-cleared form
- No third-party dependencies beyond JSZip static resource
4.3 Cons / Limitations
- Plain Apex .doc parsing is best-effort only — the OLE2 binary format is complex and accuracy is lower
- Regex-based name extraction can mis-split single-word names or pick up company names instead
- Skills and Education accuracy depends on resume formatting and consistent section headings
- Scanned or image-only PDFs cannot be parsed — a text layer is required
- Large DOCX files may strain browser-side JSZip unzip performance
5. Screenshots & Visual Reference
5.1 Component UI Description
| UI Element | Description |
|---|---|
| File upload button | Standard lightning-input type=file accepting .txt, .pdf, .doc, .docx |
| Spinner | Shown while JSZip unzips the file or Apex parseResume() is processing |
| Auto-fill form | Fields: First Name, Last Name, Email, Phone, Skills (textarea), Years of Experience (number), Education (textarea). All editable after parsing. |
| Save Applicant button | Disabled while a save is in progress. Calls saveApplicant() on click. |
| Success toast | Shows 'Job Applicant created! Record Id: [Id]' on successful insert |
| Error toast | Shows the error message returned by Apex if the insert fails |
5.2 Data Flow Diagram
Recruiter uploads resume
→ LWC: validate extension
DOCX → JSZip.loadAsync() → extract word/document.xml → strip to plain text
Others → FileReader.readAsDataURL() → extract Base64
→ Apex: ResumeParserController.parseResume(base64, filename)
→ decode by extension
→ PDF: scan BT/ET blocks, Tj, TJ operators
→ TXT/DOC/DOCX: direct string processing
→ apply Regex for Email, Phone, Name, Skills, Experience, Education
→ return ParsedResume wrapper to LWC
→ LWC: populate form fields
→ Recruiter reviews and edits
→ LWC: saveApplicant(firstName, lastName, email, phone, skills, experience, education)
→ Apex: insert Job_Applicant__c
→ return new record Id
→ LWC: show success toast, clear form5.3 Screenshot Reference — As Described in the Presentation
Slide 6 of the original presentation (05 / IN ACTION — Screenshots) shows two visuals:
| Screenshot | What It Shows |
|---|---|
| Resume parsed — form auto-filled | The resumeUploader component with all form fields populated from an uploaded .docx file. Name, Email, Phone, Skills, Years of Experience, and Education are all filled in. The recruiter has not yet clicked Save. |
| Success toast | The component after clicking Save Applicant, showing the green success toast: 'Job Applicant created! Record Id: [Salesforce Id]'. The form has been cleared ready for the next upload. |
