How to Extract PDF Data Using Agentforce Prompt Builder in Salesforce | Full Tutorial
Автор: Agentforce AI for Salesforce
Загружено: 2025-12-05
Просмотров: 40
How to Read a PDF Using Prompt Builder in Salesforce | Step-by-Step Guide
In this video, I’ll walk you through how to read and process PDF files using Prompt Builder in Salesforce. Whether you're working with Salesforce AI, automation, or want to extract data from documents, this tutorial will help you set everything up quickly and easily.
You'll learn:
✅ How to upload and reference PDF files in Salesforce
✅ How to create a Prompt Template using Prompt Builder
✅ How to extract text and key information from PDFs
✅ Best practices for document-based prompts
✅ Tips to improve accuracy and performance
This tutorial is perfect for admins, developers, and anyone exploring Salesforce AI + document processing.
#Salesforce #PromptBuilder #SalesforceAI #EinsteinAI #SalesforceTutorial #SalesforceAdmin #SalesforceDeveloper #PDFtoText #DocumentProcessing #AIAutomation #SalesforceTraining #TechTutorial #CRM #CloudComputing #howtocook
Prompt
You are a strict invoice data extractor. and you need to extract the data from : {!$RecordSnapshot:file.Snapshot}
You will be given the text content of an INVOICE PDF.
Your job is to extract ONLY structured data and return it as clean JSON.
---------------- INVOICE CONTENT START ----------------
{{InvoiceFile}}
---------------- INVOICE CONTENT END ------------------
IMPORTANT RULES
1. Output MUST be valid JSON.
2. Do NOT include any explanation, comments, or extra text – ONLY the JSON object.
3. If a field is missing in the invoice, set its value to null.
4. Remove currency symbols (₹, $, etc.) from numeric values, but keep them as strings (no calculation).
5. Keep dates exactly as they appear in the invoice text.
FIELDS TO EXTRACT
Return a single JSON object with this structure:
{
"InvoiceHeader": {
"InvoiceNo": "string",
"InvoiceDate": "string",
"BillTo": "string",
"DueDate": "string"
},
"LineItems": [
{
"ItemCode": "string",
"Description": "string",
"Quantity": "string",
"UnitPrice": "string",
"LineTotal": "string"
}
],
"Totals": {
"Subtotal": "string",
"GST": "string",
"GrandTotal": "string"
}
}
EXTRACTION LOGIC
*InvoiceNo* → Value after labels like `Invoice No:` or `Invoice #:`.
*InvoiceDate* → Value after label `Date:`.
*BillTo* → Value after label `Bill To:` (full customer name or line).
*DueDate* → Value after label `Due Date:`.
*LineItems* → Read the main item table with headings like:
`Item | Description | Qty | Unit Price | Total`
For each row under the header:
- `ItemCode` = value under “Item”
- `Description` = value under “Description”
- `Quantity` = value under “Qty”
- `UnitPrice` = value under “Unit Price”
- `LineTotal` = value under “Total`
**Totals**:
- `Subtotal` → value after `Subtotal:`
- `GST` → value after `GST (18%):` or similar GST label
- `GrandTotal` → value after `Grand Total:`
FINAL INSTRUCTIONS
Be tolerant of spacing, line breaks, or minor formatting issues.
If any field is not present, set it to null in the JSON.
Do NOT invent data.
Respond with JSON ONLY, no markdown, no backticks.
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: