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 Automate / Extract nested Tables ...
Power Automate
Unanswered

Extract nested Tables from PDF across multiple pages

(0) ShareShare
ReportReport
Posted on by 29

Hi,

1. I would like to extract data from a table that might span on several pages only for 1 row. I tried Extract Tables from PDF but it only returns other tables in the page, not from the one that I want. I also tried Extract text from PDF, but I don't think there's a fixed keyword that I could use for regex. I've attached the pages for reference. 

 

2. I would like to write the extracted tables into an excel file.

 

Any assistance is highly appreciated.

Capture1.PNG
I have the same question (0)
  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @RookAils 

     

    Since you said, the extract table from pdf is not working or it is not extracting pages as expected, so other way to try around would be to get text from PDF and using regex combinations to extract data one by one .

     

    So current logic you can try is :

     

    1. Extract text from pdf from one page at a time

    2. use regex to extract data required 

    3. write it to excel

     

    Repeat the steps for others

     

    Also to extract the line items data from the page (the pdf seems to be of Invoice), you can tryout some models in AIBuilders as well that would help to extract data quite faster

    Nived_Nambiar_0-1692585795770.png

     

     

    Hope it helps !

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Extract text from PDF seems to be your best bet here. Try enabling the "Optimize for structured data" toggle under the advanced options of the action:

    Agnius_0-1692590791801.png

     

    This can change the output a bit and make it easier to parse with regex. 

     

    If you shared the PDF, or the text output from the Extract text from PDF action, as well as the specific values you need, we might be able to come back with some regex for retrieving your 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.

  • RookAils Profile Picture
    29 on at

    Sure @Agnius I just want each of the item here into its own separate columns. I cant really figure out the regex since these values aren't fixed and the layout seems seems off(notice the slight shift on the column header allignment), and this is only the first page.

    Capture2.PNG
  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @RookAils 

     

    Did you tried AI Builder, may be that would help ?

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

  • RookAils Profile Picture
    29 on at

    I did tried that, but it cant really identify multipage tables that well, had low confidence score even after provided 13 documents for this format and now I'm out of capacity😅

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    You can usually provide the regex to capture a specific pattern, like decimals coming after some whitespaces, followed by other decimals, etc.

    If you can give me a text blob and the specific values you need extracted, I can provide a sample regex.

    -------------------------------------------------------------------------
    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.

  • RookAils Profile Picture
    29 on at

    I see.  Yeah I've attached the text in my last reply. Basically I need the whole part to be stored in each of their variable.

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Yeah, but that's an image. Can you just post it as a text blob?

  • RookAils Profile Picture
    29 on at

       Product Description                                            Unit           Unit              Total            Total

                     Type of Package                                            Net WT        Gr. WT           Net WT          Gr. WT

                                                                                     (MT)           (MT)              (MT)             (MT)

             ________________________________________________________________________________________________________________________________________

             1       DIETHANOLAMINE

                     STEEL DRUM 228 KG

                     Batch 51103AN                                                0.228          0.245            10.488           11.270

                     ( 46.000 DR X 0.228 MT )

                     Delivery Plant : M158

                     DIETHANOLAMINE

                     STEEL DRUM 228 KG

                     Batch 51103AO                                                0.228          0.245             7.752            8.330

                     ( 34.000 DR X 0.228 MT )

                     Delivery Plant : M158

             

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Okay, so, assuming you always have a batch number, you can get the net weights per unit with the following regex:

    (?<=Batch\s[0-9A-Z]+\s+)\d+\.\d+

    And then you just keep building on this same regex by moving the decimals into the positive lookbehind, so that you exclude that, but pick the next one:

    • Gross weights per unit - (?<=Batch\s[0-9A-Z]+\s+\d+\.\d+\s+)\d+\.\d+
    • Net weights total - (?<=Batch\s[0-9A-Z]+\s+(\d+\.\d+\s+){2})\d+\.\d+
    • Gross weights total - (?<=Batch\s[0-9A-Z]+\s+(\d+\.\d+\s+){3})\d+\.\d+

    The following regex will get you the product descriptions: [A-Z]+(\r?\n.+){4}Batch\s[0-9A-Z]+ but this will include some of those blank lines between the text, so you will need to do some text processing to clean those.

     

    If you need the quantity in the brackets, you can get that with \(\s.+\)

    If you need the delivery plant, too, you can get it as Delivery\sPlant\s:\s[A-Z0-9]+

     

    -------------------------------------------------------------------------
    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.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 312 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 154 Super User 2026 Season 2

#3
trice602 Profile Picture

trice602 143 Super User 2026 Season 2

Last 30 days Overall leaderboard