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 / Help With Table Extrac...
Power Automate
Unanswered

Help With Table Extraction

(0) ShareShare
ReportReport
Posted on by 19

This is a little bit more of a complex problem so I will give you a little more detail. 

 

I am trying to transfer data from a large number of pdfs into an excel sheet.

 

So the pdf's I am working with come in slightly different formats. One of them (See First Image (bottom page)) has a single table that I need. However, when I run this type of pdf through the Extracted PDF tables command, I always received back 2 tables. One (2 columns and x number of rows) with the information of the Metered Rate, Tubing Pressure, Mechanical Loss, etc. The Second table (the data I need) picks up the rest of the data (ex: 998 - 1018, PERI, 1134 - 1145 100%). As a result I use the command Write to Excel Worksheet on the following value ExtractedPDFTables[1].datatable in order to only pick up the data from the second table and then import said data into my excel spreadsheet. This is what I want to happen.

 

However, when doing the second type of pdf (please see 1st image first page), the program has a problem. With this type of pdf there are two tables that I will need to extract to Excel. However, when running the Extracted PDF tables, it still only picks up 2 tables. The second table comes out exactly how the second table comes out in the first scenario so I have no problems. However, the first table includes the undesired information along with the data I need. I have attached images of first scenario in image 2 and the images of second type of pdf in image 3. 

 

For clarification for the second scenario first table, I only want the information in rows 5-6.

 

I am wondering if there are any workarounds or solutions you guys may have to workaround this issue. Thanks for your time.

 

 

I have the same question (0)
  • lbendlin Profile Picture
    8,726 Super User 2026 Season 1 on at

    Run separate flows, one per file structure. Or remove the static values after ingestion.

     

    Where are you storing the results?

  • Deenuji_Loganathan_ Profile Picture
    6,255 Moderator on at

    @KaiHalpin 

     

    Please follow the below approach:

    Deenuji_0-1719251597510.png

     

    Code:

     

    Variables.CreateNewDatatable InputTable: { ^['Column1', 'Column2'], [$'''Metered Raye''', $''':1000'''], [$'''Tubing Pressure''', $''':495'''], [$'''Mechanical Loss''', $''''''], [$'''Interval Type: Interval %% Loss Remarks''', $''''''], [$'''______________________________________''', $''''''], [$'''1420 - 1503 PERI 1450 - 1490 77%%''', $''''''], [$'''1580 - 1561 PERI 15200 - 1561 23%%''', $''''''], [$'''Lower B''', $''''''], [$'''______________________________________''', $''''''], [$'''Metered Rate''', $''':650 B/D'''], [$'''Tubbing Pressure''', $''':570 PSI'''] } DataTable=> DataTable
    Variables.FindOrReplaceInDataTable.FindItemInDataTableByColumnIndex DataTable: DataTable AllMatches: True ValueToFind: $'''__''' MatchCase: False MatchEntireCellContents: False ColumnNameOrIndex: 0 DataTableMatches=> DataTableMatches
    SET StartRow TO DataTableMatches[0][0]
    Text.ToNumber Text: StartRow Number=> StartRowAsNum
    SET StartRowAsNum TO StartRowAsNum + 1
    LOOP LoopIndex FROM 1 TO StartRowAsNum STEP 1
     Variables.DeleteRowFromDataTable DataTable: DataTable RowIndex: 0
    END
    Variables.FindOrReplaceInDataTable.FindItemInDataTableByColumnIndex DataTable: DataTable AllMatches: True ValueToFind: $'''Lower''' MatchCase: False MatchEntireCellContents: False ColumnNameOrIndex: 0 DataTableMatches=> DataTableMatches
    SET EndRow TO DataTableMatches[0][0]
    Text.ToNumber Text: EndRow Number=> EndRowAsNum
    SET EndRowAsNum TO EndRowAsNum
    LOOP LoopIndex FROM EndRowAsNum TO DataTable.RowsCount STEP 1
     Variables.DeleteRowFromDataTable DataTable: DataTable RowIndex: EndRowAsNum
    END

     

     

     

    How to copy/paste the above code in your power automate desktop?

    Deenuji_1-1719251687591.gif

     

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 223

#2
David_MA Profile Picture

David_MA 210 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 175

Last 30 days Overall leaderboard