web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Building a Copilot Stu...
Power Apps
Answered

Building a Copilot Studio agent to validate shipping invoices

(3) ShareShare
ReportReport
Posted on by 60

Hi all,

 

I'm trying to build a Copilot Studio agent that processes shipping invoices stored in SharePoint as PDFs, extracts individual shipment line items, matches each one to a rate card stored in an Excel file in SharePoint, and flags any pricing discrepancies.

 

When I describe the problem to Copilot chat, it seems to understand exactly what needs to happen. But translating that into something that actually works within Copilot Studio agent is where I'm stuck.

 

I came across this video about Microsoft's Document Processor managed agent, which looks promising but I'm not sure whether it can handle repeating line items within a single document rather than just document-level field extraction. Has anyone used it for something like this?

 

Has anyone built something similar with Copilot Studio?

Categories:
I have the same question (0)
  • Verified answer
    Sunil Kumar Pashikanti Profile Picture
    2,069 Moderator on at

    Yes, the Document Processor managed agent is a good starting point for this scenario.

    That said, repeating line items require structured extraction (for example, arrays in JSON) and downstream looping, typically implemented through Agent Flows or Power Automate.

    Most successful implementations combine:

    • Document Processor / AI Builder for document and line‑item extraction
    • Power Automate for iterating through line items and matching them against an Excel‑based rate card
    • Copilot Studio for orchestration, validation logic, and the conversational experience

    This is a known and common architectural pattern, and your question is not unusual.

    Copilot Studio alone does not automatically loop invoice line items unless:

    • The document extraction model outputs structured arrays, or
    • You combine Document Processor / AI Builder extraction with Agent Flows or Power Automate for iteration, comparison, and validation.

    In short, the challenge here is architectural rather than conceptual, the pieces exist, but they need to be composed correctly.

     
    ✅ If this answer helped resolve your issue, please mark it as Accepted so it can help others with the same problem.
    👍 Feel free to Like the post if you found it useful.

    Sunil Kumar Pashikanti, Moderator
    Blog:
     https://sunilpashikanti.com/posts/
     
  • Verified answer
    11manish Profile Picture
    2,126 on at
    Copilot Studio alone cannot reliably process PDF invoices with repeating line items.
     
    The Document Processor agent can extract simple fields but is not robust for multi-row table extraction.
     
    The correct approach is to use Copilot Studio as the front-end, trigger a Power Automate flow, extract structured data using Azure Document Intelligence (or AI Builder for simpler cases), then apply matching logic against your Excel rate card and return summarized results or a downloadable file.
     
    This hybrid architecture is the only reliable way to implement your scenario at scale.
  • Verified answer
    Haque Profile Picture
    2,543 on at
    Hi @CT-20042235-0,
     
    Microsoft’s Document Processor managed agent in Copilot Studio is designed to extract structured information from documents like invoices, contracts, and forms using AI-powered document understanding models. It supports both document-level field extraction and, importantly, can handle repeating line items within a single document—such as multiple shipment line items on an invoice.
     
    You can configure the Document Processor managed agent to:
    • Upload sample documents (e.g., your shipping invoices)
    • Train or use prebuilt AI models that identify and extract repeating line items as structured data
    • Validate and review extracted data within Copilot Studio
    • Integrate the extracted line items with downstream logic (e.g., matching against your Excel rate card)

     

    But for PDF document extraction, we need to take extra precaution. Copilot Studio alone is not yet fully reliable for extracting complex repeating line items from PDFs like shipping invoices. In that case I agree what  has mentioned. 

     

     

  • Verified answer
    Valantis Profile Picture
    4,895 on at
     
     
    The Document Processor agent is currently in preview and English only. The docs describe it extracting structured fields from documents using a sample you upload during configuration. It does support configuring validation rules on extracted data. However the docs don't explicitly confirm repeating line item extraction as an array output it's described more as field-level extraction than table/row iteration.
     
    For your specific scenario (multiple shipment line items per invoice, each matched against a rate card), the Document Processor agent alone is likely not sufficient.
     
    The reliable path for line item iteration is:
    1. Document Processor or AI Builder invoice model to extract the document  AI Builder's prebuilt Invoice Processing model specifically outputs line items as a structured collection, which is what you need

    2. Power Automate flow to loop through each extracted line item, look up the matching rate in your Excel rate card using the List rows present in table action filtered by shipment type/SKU, compare the invoice price against the rate card price, and accumulate any discrepancies

    3. Copilot Studio as the front end user uploads the PDF, agent triggers the flow, flow returns a summary of discrepancies
     
    One important thing to be aware of: Copilot Studio enforces a roughly 2-minute timeout on synchronous flow calls. If your invoices are large or the Excel rate card has many rows, the flow may time out. If that happens, use an async pattern  the flow runs in the background and posts the result back to the user via a proactive message or stores it in Dataverse for the agent to retrieve on follow-up.
     
     
     

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

    💼 LinkedIn

    ▶️ YouTube

  • CT-20042235-0 Profile Picture
    60 on at
     
    I have a follow-up question I was hoping you could advise on. I'm using a carrier rate card stored as an Excel file in SharePoint to validate shipping charges. The rate card has multiple tabs with zone mappings and weight-tiered pricing tables.

    Currently I'm manually restructuring the rate card tabs into Excel Tables so Power Automate can query them using List rows. However this is tedious and needs to be repeated annually when the carrier updates the rate card.

    I'm wondering if you have any recommendations on how to automate the rate card analysis, ideally so the system can read the rate card in its original format and apply the correct rates without requiring manual restructuring each year.
     
    Any guidance you can offer would be greatly appreciated.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 936

#2
11manish Profile Picture

11manish 628

#3
Valantis Profile Picture

Valantis 604

Last 30 days Overall leaderboard