Back to insights
Salesforce AIAIResume

Resume Auto-Fill Agent

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

Deerak Kumar T10 min read

Salesforce Developer

Resume Auto-Fill Agent cover infographic

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 LabelAPI Name
Name (auto-generated)Name
First NameFirst_Name__c
Last NameLast_Name__c
EmailEmail__c
PhonePhone__c
SkillsSkills__c
EducationEducation__c
Years of ExperienceYears_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.

LayerResponsibility
LWC — resumeUploaderUpload 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 — ResumeParserControllerparseResume() 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 LayersaveApplicant() 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 FieldSalesforce Field (API Name)
First NameFirst_Name__c
Last NameLast_Name__c
EmailEmail__c
PhonePhone__c
SkillsSkills__c
Years of ExperienceYears_of_Experience__c (Number)
EducationEducation__c
First Name + Last NameName (auto-generated by Salesforce)

2.3 File Format Handling

FormatHow It Is Processed
TXTRead directly as plain text via FileReader API. Sent as Base64 to Apex, decoded, and Regex applied.
PDFSent 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.
DOCBest-effort parsing on the OLE2 binary format directly in Apex. Accuracy is lower than other formats.
DOCXUnzipped 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

  1. Download jszip.min.js and upload it under Salesforce Setup → Static Resources, naming it JSZip. This enables in-browser unzipping of .docx files.
  2. 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).
  3. Deploy the Apex class ResumeParserController with the parseResume() and saveApplicant() methods.
  4. Build and deploy the resumeUploader LWC with a file selector, a spinner, and the editable auto-fill form.

3.2 Using the Component

  1. Add the resumeUploader component to any Lightning page in App Builder. Save and Activate.
  2. Click the file upload button and select a resume in TXT, PDF, DOC, or DOCX format.
  3. 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.
  4. For TXT, PDF, DOC: the file is read as Base64 via the FileReader API and passed to Apex.
  5. 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.
  6. 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.
  7. 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:

FieldRegex Strategy
EmailStandard email pattern: [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}
PhoneMatches common number formats including country codes and separators
NameLooks for capitalized words near the top of the document (first non-email, non-phone line)
SkillsLooks for a section heading containing 'skills' and extracts the following lines
Years of ExperienceLooks for patterns like '3 years', '5+ years', 'X years of experience'
EducationLooks for a section heading containing 'education' and extracts degree and institution lines
PDF parsing note: The Apex PDF parser scans for BT/ET text blocks, Tj string operators, and TJ array operators. It only works on PDFs with an embedded text layer. Scanned resumes or image-only PDFs will produce empty results — the recruiter must type the fields manually in that case.

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 ElementDescription
File upload buttonStandard lightning-input type=file accepting .txt, .pdf, .doc, .docx
SpinnerShown while JSZip unzips the file or Apex parseResume() is processing
Auto-fill formFields: First Name, Last Name, Email, Phone, Skills (textarea), Years of Experience (number), Education (textarea). All editable after parsing.
Save Applicant buttonDisabled while a save is in progress. Calls saveApplicant() on click.
Success toastShows 'Job Applicant created! Record Id: [Id]' on successful insert
Error toastShows 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 form

5.3 Screenshot Reference — As Described in the Presentation

Slide 6 of the original presentation (05 / IN ACTION — Screenshots) shows two visuals:

ScreenshotWhat It Shows
Resume parsed — form auto-filledThe 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 toastThe 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.
Topics:AIResumeAutomation

Ready to accelerate your digital transformation?

Partner with Subsel to build modern CRM, AI-enabled automation, and enterprise systems that scale.