Power Automate  

Classify Invoice vs. Non‑Invoice documents using AI Builder and Power Automate

This article outlines an intelligent document‑classification solution that automatically distinguishes Invoice and Non‑Invoice documents using Microsoft AI Builder integrated with Power Automate. The goal is to streamline document routing, reduce manual review, and enable downstream automation for finance operations.

System Overview

ComponentRoleKey Features
AI Builder Document Classification ModelCore IntelligenceTrained on labeled invoice/non‑invoice samples; returns prediction and confidence score
Power Automate FlowOrchestration layerTriggers on document upload; invokes AI Builder; applies conditional logic
SharePoint / DataverseStorage and metadataStores documents, classification results, and audit trail
Power BI DashboardMonitoringTracks classification accuracy, confidence trends, and workflow performance
Copilot_20260707_210452

Implementation Steps

1. AI Builder Model

  • Type: Document Classification model

  • Training Data:

    • Collect sample documents (PDF, Word, images).

    • Label them as Invoice or Non‑Invoice.

  • Training Process:

    • Upload at least 50–100 documents per category for accuracy.

    • Train and publish the model in AI Builder.

2. Dataverse / SharePoint Storage

  • Store incoming documents in a SharePoint library or Dataverse table.

  • Metadata fields:

    • Document Name

    • Classification Result

    • Confidence Score

    • Processing Status

3. Power Automate Flow

Trigger Options:

  • SharePoint: "When a file is created in a folder"

  • Dataverse: "When a row is added"

Flow Steps

  1. Input Document

    • Get file content from SharePoint/Dataverse.

  2. Call AI Builder Model

    • Use AI Builder – Classify documents action.

    • Pass the file content to the trained model.

  3. Process Output

    • Model returns:

      • Predicted Category (Invoice / Non‑Invoice)

      • Confidence Score

  4. Conditional Logic

    • If Invoice:

      • Move to "Invoices" folder or update Dataverse record.

      • Trigger downstream workflows (e.g., extract invoice data, send to Finance).

    • If Non‑Invoice:

      • Move to "Other Documents" folder.

      • Optionally notify or archive.

  5. Notifications

    • Send email/Teams alert with classification result and confidence score.

Example Flow (Step-by-Step)

  1. Trigger: File uploaded to SharePoint → "Invoices-Processing" library.

  2. Action: AI Builder → Classify document.

  3. Condition:

    • If result = "Invoice" → Move to "Invoices" library.

    • Else → Move to "Non-Invoices" library.

  4. Update Metadata: Add classification result + confidence score.

  5. Notify: Email Finance team with document details.

Benefits

  • Eliminates manual sorting.

  • Improves accuracy and auditability.

  • Enables end‑to‑end automation for finance workflows.

  • Provides real‑time insights via Power BI.

Future Enhancements

  • Add multi‑class classification (e.g., Purchase Orders, Receipts).

  • Integrate with Dynamics 365 Finance for automated posting.

  • Extend to multilingual document support.