Exploring File Processing Capabilities in Salesforce : Meera R Nair
by: Meera R Nair
blow post content copied from Meera R Nair - Salesforce Insights
click here to view original post
In this blog post series, we will explore the different file processing capabilities available in Salesforce, including:
-
Prompt Builder
-
Document AI
-
Intelligent Document Reader
Before diving into the implementation details, let’s start with a comparison of these options to understand their unique features and use cases.
Comparison:
Use Case: Automating Case Status Update with Prompt Builder
Let’s implement the following use case using Prompt Builder:
A customer has purchased a laptop and wants to create a case for a hardware issue — for example, the battery is not working. The customer sends an email to the support address, and the system should automatically create a case in Salesforce.
Along with the email, the customer attaches two documents:
-
Product Invoice
-
Warranty Card
The requirement is to parse both documents and extract the following key details:
-
Customer Name
-
Product Description
-
Serial Number
-
Date of Purchase (from the invoice)
-
Warranty-related details (from the warranty card)
Once the data is extracted, it must be validated against Salesforce records:
-
Check for a valid Asset record matching the provided serial number.
-
If no matching asset is found, update the Case Product Status (custom field) as “Product Not Found.”
-
-
If a valid asset exists, verify whether it falls within the warranty period by checking the related Entitlement record.
-
If the asset is within the warranty period, update Case Product Status to “In Warranty.”
-
Otherwise, update it to “Out of Warranty.”
-
Implementation Details
- Set up Email to Case
- Create Prompt Builder Template for file parsing
- Record Triggered Flow on Case creation
- Invocable Apex Class Creation for json parsing and validations
- Set up Email to Case
- Create Prompt Builder Template for file parsing
Make sure to use insert resource and select the related atatchments(combined attachments) to get the files for processing.
This makes sure that the prompt is working as expected.
- Record Triggered Flow on Case creation
Keep the criteria for flow execution simple so that it’s easy to test the setup.
-
Add an Action — Create an action named
RetrieveWarrantyDetailsto invoke the Prompt Builder template for processing the attached files. -
Pass Parameters — Pass the Case record as a parameter to the action.
-
Store Response — Capture the response JSON text from the Prompt Builder in a flow variable (e.g.,
response).
- Invocable Apex Class Creation
This class accepts the JSON text and Case as input parameters, performs the necessary validations, and updates the product status accordingly.
Validation Output
We’re done! The file processing is now much simpler.
After creating a Case and saving it, you can observe that the Product Status field is automatically updated with the correct value.
Observations / Considerations
While experimenting with Prompt Builder multi-model processing, I noticed the following:
-
Model Performance:
It’s worth trying different models in Prompt Builder to compare responses.-
For simple files, OpenAI GPT-4 performs well.
-
For complex PDFs or images, Gemini 2.5 Flash provided more accurate and reliable results.
-
-
JSON Clean-Up:
Occasionally, the generated JSON may contain unwanted or special characters, which can cause parsing issues in the Apex class.
To address this, I added the following code snippet to clean up the JSON string: -
Access Issues:
At times, Prompt Builder displayed access-related issues when trying to retrieve Case records or associated files.
November 02, 2025 at 12:04PM
Click here for more details...
=============================
The original post is available in Meera R Nair - Salesforce Insights by Meera R Nair
this post has been published as it is through automation. Automation script brings all the top bloggers post under a single umbrella.
The purpose of this blog, Follow the top Salesforce bloggers and collect all blogs in a single place through automation.
============================


Post a Comment