A production-ready unlocked package for Field Service Lightning that enables field technicians to photograph handwritten delivery tickets and service receipts, then automatically extract structured data using Agentforce AI.
📹 Video walkthrough: Watch a demo of AI Ticket Analyzer in action on Field Service Mobile at salesforce.vidyard.com/watch/bHdU7ukV8EGzmC7ZTyRaib.
This package solves the common field service challenge of manually transcribing handwritten tickets into Salesforce. Field technicians can:
- 📸 Take photos of handwritten receipts directly from their mobile device
- 🤖 Automatically extract customer, delivery, and service data using Agentforce AI
- ✍️ Handle poor handwriting quality ("chicken scratch")
- 📱 Offline detection with graceful UI degradation (requires connection for AI processing)
- ✅ Reduce manual data entry errors by 80-90%
- ⚡ Speed up ticket processing from 5-10 minutes to 30 seconds
Production Orgs:
https://login.salesforce.com/packaging/installPackage.apexp?p0=04tKj000000fTEtIAM
Sandbox Orgs:
https://test.salesforce.com/packaging/installPackage.apexp?p0=04tKj000000fTEtIAM
Prerequisites: Authenticate to your org first:
sf org login web --alias YourOrgAliasThen install the package (replace YourOrgAlias with your actual org alias):
sf package install --package 04tKj000000fTEtIAM --target-org YourOrgAlias --wait 20| Feature | Package Installation | Manual Deployment |
|---|---|---|
| Ease of Use | ✅ One-click install | ❌ Requires CLI/DevOps |
| FSL Mobile Setup | ||
| Version Management | ✅ Built-in | ❌ Manual tracking |
| Upgrades | ✅ Simple package update | ❌ Redeploy all files |
| Distribution | ✅ Share install link | ❌ Share source code |
| Best For | Production orgs, customers | Development, customization |
Note: Both installation methods require adding the Quick Action to the Work Order page layout (Step 3).
Recommendation: Use package installation for production. Use manual deployment only if you need to customize the code.
| Component | Type | Purpose |
|---|---|---|
| aiTicketAnalyzer | Lightning Web Component | Mobile-optimized file upload and AI analysis UI |
| FileUploadAIProcessor | Apex Controller | Handles file uploads and Agentforce API integration |
| FileUploadAIProcessorTest | Apex Test Class | Provides code coverage for packaging |
| Read Handwriting - Delivery Tickets | GenAI Prompt Template | AI instructions for extracting structured data from handwritten tickets |
| Analyze_Ticket_with_AI | Quick Action | One-tap access from Work Order records |
| AI Ticket Analyzer User | Permission Set | Grants Lightning SDK for FSL Mobile and required object/Apex access |
- ✅ Mobile-First Design - Touch-optimized for FSL Mobile App
- ✅ Offline Detection - Real-time status monitoring with graceful UI degradation
- ✅ Smart Validation - File type (.jpg, .png, .pdf) and size checking (up to 15MB)
- ✅ AI-Powered OCR - Handles messy handwriting with confidence scoring
- ✅ Structured Markdown Output - Readable format for clipboard copy (customizable to JSON for automation)
- Extract delivery ticket data: customer info, gallons delivered, tank levels
- Process service inspections: leak checks, certifications, connected appliances
- Monitor driver notes and safety concerns
- Track tank specifications and inspection history
- Process handwritten work order notes
- Extract time, materials, and labor data
- Capture customer signatures and approvals
- Document service completion details
- ✅ Enterprise Edition or higher
- ✅ Field Service Lightning (FSL) enabled
- ✅ Agentforce for Field Service or Agentforce AI Platform
- ✅ Prompt Builder enabled
- ✅ Flex Credits available (contact Salesforce Account Team)
- ✅ WorkOrder object accessible
- Read/Write access to WorkOrder
- Create/Read access to ContentVersion and ContentDocumentLink
- Execute Apex permission
- Access to Agentforce Prompt Templates
Before installing, verify:
- Salesforce Enterprise Edition or higher
- Field Service Lightning enabled
- System Administrator permissions
- Agentforce Platform enabled
- Prompt Builder feature enabled
- Flex Credits available
Option A: Click Installation Link (Easiest)
Click the appropriate link above for Production or Sandbox, then:
- Choose Install for Admins Only (recommended for testing)
- Click Install
- Wait 2-5 minutes for installation
Option B: Use Salesforce CLI
sf package install --package 04tKj000000fTEtIAM --target-org YourOrgAlias --wait 20 --security-type AdminsOnlyNote: Replace YourOrgAlias with your org alias from sf org login web --alias YourOrgAlias
- Step 2: Activate the prompt template "Read Handwriting - Delivery Tickets"
- Step 3: Add the Quick Action to the Work Order page layout
- Navigate to Setup → Einstein Setup
- Ensure Prompt Builder is enabled
- Navigate to Setup → Prompt Builder
- Locate the prompt template named "Read Handwriting - Delivery Tickets"
- If status shows "Draft": Click on the template → Click Activate button
- Verify: Status should now show "Active" (active and ready to use)
Note: The package deploys the template in Published status, but you must verify it's active in your org.
Configure the Quick Action:
- Navigate to Setup in Salesforce
- In the Quick Find box, type
Object Managerand select it - Find and click on Work Order
- Click Page Layouts from the left sidebar
- Click on the page layout used by your field technicians (typically Work Order Layout or FSL Work Order Layout)
- Find the Salesforce Mobile and Lightning Experience Actions section (usually at the top of the layout editor)
- In the action palette on the left, locate Analyze Ticket with AI under Quick Actions
- Drag and drop the Analyze Ticket with AI action into the Mobile & Lightning Actions section
- Position it near the top for easy access by field technicians
- Click Save
📱 Pro Tip for Mobile Users:
After adding the Quick Action to the page layout, mobile users may need to log out and log back in to the Field Service Mobile app to see the new action appear. Simply pulling down to refresh or syncing may not be sufficient due to mobile session caching.
Verify Quick Action Setup:
- Open any Work Order record in Salesforce
- Look for the Analyze Ticket with AI button in the highlights panel or actions menu
- In the Field Service Mobile App, open a Work Order and verify the action appears in the action bar
The package includes a ready-to-use permission set:
- Navigate to Setup → Permission Sets
- Find "AI Ticket Analyzer User" (installed with the package)
- Click Manage Assignments
- Click Add Assignments
- Select all field technicians and service managers who will use the FSL Mobile App
- Click Assign
What this permission set includes:
- ✅ Lightning SDK for Field Service Mobile (enables LWC in FSL Mobile App)
- ✅ Custom Applications for Field Service Mobile (required for custom app extensions)
- ✅ WorkOrder read access
- ✅ ContentVersion/ContentDocument create and read access
- ✅ ContentDocumentLink create and read access
- Open any Work Order record
- Click Analyze Ticket with AI quick action
- Upload a test image of handwritten text
- Verify AI analysis completes and returns structured JSON
- Check that file attaches to the Work Order
- Open Work Order in FSL Mobile App
- Tap "Analyze Ticket with AI" quick action
- Take photo or select from gallery
- Wait for AI processing (10-30 seconds)
- Review extracted data in structured Markdown format
- Copy to clipboard or manually enter into fields
Output Format: The AI returns well-formatted Markdown for easy reading and clipboard copying. The prompt template can be customized to output JSON instead if you need structured data for automated record creation or updates.
The AI automatically extracts:
- ✅ Customer information (name, account, address, phone)
- ✅ Delivery details (date, time, driver, truck number)
- ✅ Product information (type, gallons, price, total cost)
- ✅ Tank data (size, levels, totalizer readings)
- ✅ Service information (work order, inspections, leak checks)
- ✅ Connected appliances (heating, water heater, generator, etc.)
- ✅ Safety alerts and follow-up requirements
| Aspect | Details |
|---|---|
| API Version | 61.0 |
| Package Type | Unlocked (namespace-free) |
| Package ID | 0HoKj000000XuZsKAK |
| Version | 1.3.0-1 (Released) |
| AI Model | OpenAI GPT-4 Omni (vision-capable) |
| Supported Files | .jpg, .png, .pdf (Note: .jpeg not supported) |
| Max File Size | 15 MB |
| Code Coverage | Packaging-validated |
| Security | with sharing on Apex, Einstein Trust Layer for AI |
- Sharing Model:
with sharingenforced on Apex controller - File Access: Automatically linked to parent Work Order
- Data Privacy: Files stored in Salesforce Files with standard encryption
- AI Processing: Uses Salesforce Einstein Trust Layer (data not used for model training)
- Audit Trail: All file uploads logged in ContentVersion history
Cause: Agentforce not enabled or no Flex credits available
Solution:
- Verify Agentforce is enabled in Setup → Einstein Setup
- Check Flex credit balance
- Contact Salesforce Account Team for credit allocation
Cause: Template didn't deploy or isn't activated
Solution:
- Navigate to Setup → Prompt Builder
- Verify "Read Handwriting - Delivery Tickets" template exists
- Check Status is "Active" (if showing "Draft", click template and click Activate)
- If template is missing entirely, redeploy the package
Cause: Page layout not updated
Solution:
- Verify page layout includes the action
- Clear browser cache (Cmd+Shift+R or Ctrl+Shift+R)
- Check user has WorkOrder object access
Cause: File size, type, or permissions
Solution:
- Verify file is under 15MB
- Check file extension is .jpg, .png, or .pdf (Note: .jpeg files are not supported by the AI model)
- Confirm user has ContentVersion create permission
- Review Apex debug logs for details
Cause: Quick Action not added to Work Order page layout
Solution:
The Analyze Ticket with AI Quick Action must be added to the Work Order page layout. Follow Step 3 in the installation instructions above to add the Quick Action through Setup → Object Manager → Work Order → Page Layouts.
Mobile users: After the admin adds the Quick Action to the page layout, you may need to log out and log back in to the Field Service Mobile app for the action to appear.
Cause: User missing required FSL Mobile permissions
Solution:
Two critical permissions are required for LWC components to function properly within the FSL Mobile App:
- Lightning SDK for Field Service Mobile (FieldServiceAccess)
- Custom Applications for Field Service Mobile (CustomMobileAppsAccess)
Steps to fix:
- Navigate to Setup → Permission Sets
- Find "AI Ticket Analyzer User" permission set
- Click Manage Assignments
- Verify the affected user is assigned to this permission set
- If not assigned: Click Add Assignments → Select the user → Click Assign
- CRITICAL: Have the user log out and log back in to the FSL Mobile App (pulling down to refresh is NOT sufficient)
If you prefer to deploy the source code directly instead of installing the package:
# Clone the repository
git clone https://github.com/amurthi-salesforce/AI_Ticket_Analyzer.git
cd AI_Ticket_Analyzer
# Deploy the components (replace YourOrgAlias with your actual org alias)
sf project deploy start --source-dir force-app --target-org YourOrgAlias --test-level RunLocalTestsIMPORTANT: After deploying the source code, you MUST add the Quick Action to the Work Order page layout through the Salesforce UI (see Step 3 in the Installation section above). Also ACTIVATE the deployed prompt template.
Follow the page layout configuration steps to add the "Analyze Ticket with AI" Quick Action to the Work Order layout used by field technicians.
For issues, questions, or feature requests:
- Review Documentation - Check this README and troubleshooting section
- Debug Logs - Setup → Debug Logs (enable for your user)
- GitHub Issues - File an issue in the repository
- Salesforce Support - Contact for Agentforce enablement questions
This project is licensed under the Apache License 2.0.
Contributions are welcome! Please read our Contributing Guide and our Code of Conduct before submitting a pull request. All contributors must sign the Salesforce CLA.
Please review our Security Policy for guidance on reporting vulnerabilities. Do not file public GitHub issues for security concerns.
- Salesforce DX Developer Guide
- Agentforce Documentation
- Field Service Lightning
- Lightning Web Components
Package Version: 1.3.0-1 Last Updated: March 8, 2026 Status: ✅ Production Ready