You are here:
Review Contract Data and Update Records Example
This example walks through a screen flow where a sales operations analyst reviews extracted contract data, corrects low-confidence values, then updates Contract and Opportunity records.
Required Editions
| Available in: Lightning Experience |
| View supported editions. |
| This feature requires the MuleSoft for Flow: IDP add-on. Professional Edition requires the API access add-on. To purchase, contact your Salesforce account executive. |
| Document processing features require Einstein generative AI turned on in Setup, and Data 360 provisioned and enabled for your org. |
| MuleSoft for Flow: IDP features used with Agentforce require the Foundations or Agentforce 1 edition. To purchase these editions, contact your Salesforce account executive. |
| User Permissions Needed | |
|---|---|
| To create, read, edit, and delete document processing configurations: | Manage Document Processing Configurations |
| To open, edit, or create an orchestration in Flow Builder: | Manage Flow |
| To create screen flows for human review interfaces: | Manage Flow |
A sales operations analyst manually reviews contracts and populates Salesforce records with agreement date, amount, and account name. This example automates that process with a human-in-the-loop step: the flow extracts data from an uploaded contract, shows a review screen where the analyst can view and edit low-confidence values, then updates the Contract record and validates the amount against an Opportunity record. If the amounts match, the flow checks a validated box on the Opportunity and updates the contract number. Extraction and review run on the same flow path, so Content Document ID and Document Processing Configuration ID auto-populate.
For a scenario where a user attaches a document to a record and reviews in the Approvals experience via an orchestration, see Process and Review Attached Documents Example.
Before you build this example:
- Create a document processing configuration that extracts contract fields (for example, agreement date, total amount, contract number, account name). See Define What Data to Extract from Your Documents.
- Ensure you have Contract and Opportunity objects with the fields you want to update (for example, agreement date, total amount, contract number, and a validated checkbox on Opportunity).
- Understand the pipeline pattern. See Extracting Data from Digital and Scanned Documents.
-
Open the Flows list view.
- From Setup, in the Quick Find box, enter Flows, and then select Flows.
- From the Automation app, select the Flows tab.
- From the Flows tab in any Lightning app, click the actions menu and select Open Flow.
-
Create a screen flow.
- From the Automation app, click New | Screen | Screen Flow.
- From Setup, click New Flow | Screen | Screen Flow.
-
Add a Screen element as the start and add the File Upload screen input component so
users can upload a document (or add another trigger that provides a Content Document
ID).
For multiple files, add a Loop element and place the extraction and review steps inside the loop.
-
Add the Extract Data from Document action and configure it.
- Set Content Document ID to the document from your trigger or screen (for example, from the file upload).
- Set Document Processing Configuration to your contract extraction configuration.
The action outputs Content Document ID, Document Processing Configuration ID, and Extracted Data. See Flow Core Action: Extract Data from Document.
-
Add a Decision element to route to the review screen when your conditions require human
review.
- Define outcomes based on confidence scores, field values, or business rules (for example, if contract number confidence is below a threshold, go to review).
- For each field you want to evaluate, you can add a separate outcome or condition. Today you set the threshold in the flow; a future enhancement may provide a single review-required output from the extraction action with the threshold set in the schema editor.
-
On the outcome path that requires review, add a Screen element and add the Review
Extracted Data component.
- For Extracted Data, pass the Extract Data output from the Extract Data from Document action.
- Leave Content Document ID and Document Processing Configuration ID unset; they auto-populate when the component is on the same flow path as the extraction action.
The review screen shows all extracted fields and tables; low-confidence values appear in red. Reviewers can edit values and submit. See Review Extracted Data Screen Component.
-
After the review screen, add an Update Records element to update the Contract
record.
- Identify the record to update (for example, by record ID from the flow context).
- Set field values from the Review Extracted Data component’s Modified Data output (for example, agreement date, total amount, contract number).
-
Add a Decision element to check whether the contract amount matches the Opportunity
amount.
- Compare the amount from Modified Data to the amount on the related Opportunity record.
- If the amounts match, route to an outcome that updates the Opportunity (for example, check a validated box and set the contract number).
- Add an Update Records element on the match outcome to update the Opportunity record (validated checkbox and contract number).
- Save and activate the flow. Run it with a sample contract to verify extraction, review, and record updates.

