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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / PDF has multiple table...
Power Automate
Answered

PDF has multiple tables, need to extract correct ones

(0) ShareShare
ReportReport
Posted on by 23

Hi, I have a large PDF file which contains different types of tables. Each type of table is in the PDF multiple times. I would like to extract only one type of table, all occurences and write to an Excel sheet. 

For example, I have a table of outstanding invoices for customers. Each table contains only the invoices for one customer. We have 30 customers, so there are 30 of these tables (table 1) in the PDF.

Within the same PDF there are tables for invoices we owe to our vendors. We have 5 vendors, so there are 5 of these tables (table 2) in the PDF.

I would like to extract only table 2 information. Above each of these tables is text stating "Invoice info for Vendor xxx" where xxx is a vendor number. I can Parse Text to find "Invoice info for Vendor", then retrieve the vendor number with Get Subtext. How do I then extract the table underneath the text? I have tried Extract Tables from PDF, but when I parse the text, I do not know what the index of the associated table is.  

I have the same question (0)
  • OkanMTL Profile Picture
    703 Super User 2024 Season 1 on at

    Have you tried Document Processing offered by microsoft? This suits your problem better as this uses AI to recognize tables from a File. After your Document Processing unit it build, you can run it from cloud or PAD as you like

     

    Good luck

  • Verified answer
    Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    If you do not have a license for AI builder and don't want to purchase it, I can think of a couple of alternatives for doing this:

    1. You could split the document into a separate file per page and then process each resulting page as a separate document. This works best when:
      1. Your tables do not span over several pages,
      2. Each table starts in a new page - no pages with several tables
    2. You could just use Parse text with regular expressions to retrieve the relevant values from your PDF using certain keywords and patterns. 

    Regex is not limited by the two limitations option 1 is limited by, so it is essentially a better option, but arguably more complex to build. Especially if you are not familiar with regex at all. But since this is custom per document, in order for us to actually provide some guidance, we would need to get sample data.

     

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • StanM Profile Picture
    23 on at

    Thank you for the replies.

    I took your advice, Agnius, and split the PDF into multiple 1-page PDFs and processed that way. If the heading of a particular page was what I was looking for, I then extracted that page's table. 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard