Loading
Salesforce now sends email only from verified domains. Read More
Automate Your Business Processes
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Review Contract Data and Update Records Example

          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:

          1. 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.
          2. Create a screen flow.
            • From the Automation app, click New | Screen | Screen Flow.
            • From Setup, click New Flow | Screen | Screen Flow.
          3. 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.

          4. Add the Extract Data from Document action and configure it.
            1. Set Content Document ID to the document from your trigger or screen (for example, from the file upload).
            2. 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.

          5. Add a Decision element to route to the review screen when your conditions require human review.
            1. Define outcomes based on confidence scores, field values, or business rules (for example, if contract number confidence is below a threshold, go to review).
            2. 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.
          6. On the outcome path that requires review, add a Screen element and add the Review Extracted Data component.
            1. For Extracted Data, pass the Extract Data output from the Extract Data from Document action.
            2. 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.

          7. After the review screen, add an Update Records element to update the Contract record.
            1. Identify the record to update (for example, by record ID from the flow context).
            2. Set field values from the Review Extracted Data component’s Modified Data output (for example, agreement date, total amount, contract number).
          8. Add a Decision element to check whether the contract amount matches the Opportunity amount.
            1. Compare the amount from Modified Data to the amount on the related Opportunity record.
            2. If the amounts match, route to an outcome that updates the Opportunity (for example, check a validated box and set the contract number).
          9. Add an Update Records element on the match outcome to update the Opportunity record (validated checkbox and contract number).
          10. Save and activate the flow. Run it with a sample contract to verify extraction, review, and record updates.
           
          Loading
          Salesforce Help | Article