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 information fr...
Power Automate
Unanswered

extract information from PDf and store it in excel using Desktop flow

(0) ShareShare
ReportReport
Posted on by 8

Hi All,

 

i am new to power automate, and i am try to get some hands-on on Power automate Desktop flows.

 

i have few pdf files which contains few information like Invoice no, Billed To Amount etc...

 

i have read the multiple file from folder, and launched excel file to store the extracted information then itereate through the each files using for each then used extarct text from Pdf action and stored in a variable extractedText.

 

Now how to find above information from it. see below img for reference

 

Rakesh_Tiwari_0-1677676499151.png

Thanks in advance

Rakesh

I have the same question (0)
  • Kaif_Siddique Profile Picture
    2,108 Super User 2024 Season 1 on at

    Hi @Rakesh_Tiwari ,

     

    Here is a solution:

    Kaif_Siddique_0-1677702634125.png

     

    Kaif_Siddique_1-1677702644642.png

    Copy and Paste to PAD

    Folder.GetFiles Folder: $'''D:\\Sample Files''' FileFilter: $'''*.pdf''' IncludeSubfolders: False FailOnAccessDenied: True SortBy1: Folder.SortBy.NoSort SortDescending1: False SortBy2: Folder.SortBy.NoSort SortDescending2: False SortBy3: Folder.SortBy.NoSort SortDescending3: False Files=> Files
    Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: $'''D:\\Invoice Data.xlsx''' Visible: True ReadOnly: False Instance=> ExcelInstance
    Excel.GetFirstFreeColumnRow Instance: ExcelInstance FirstFreeColumn=> FirstFreeColumn FirstFreeRow=> FirstFreeRow
    LOOP FOREACH CurrentItem IN Files
    Pdf.ExtractTablesFromPDF.ExtractTables PDFFile: CurrentItem MultiPageTables: True SetFirstRowAsHeader: True ExtractedPDFTables=> ExtractedPDFTables
    Variables.RetrieveDataTableColumnIntoList DataTable: ExtractedPDFTables[0].DataTable ColumnNameOrIndex: 0 ColumnAsList=> BilledTo
    Excel.WriteToExcel.WriteCell Instance: ExcelInstance Value: BilledTo Column: 1 Row: FirstFreeRow
    Variables.RetrieveDataTableColumnIntoList DataTable: ExtractedPDFTables[0].DataTable ColumnNameOrIndex: 1 ColumnAsList=> DateofIssue
    Excel.WriteToExcel.WriteCell Instance: ExcelInstance Value: DateofIssue Column: 2 Row: FirstFreeRow
    Variables.RetrieveDataTableColumnIntoList DataTable: ExtractedPDFTables[0].DataTable ColumnNameOrIndex: 2 ColumnAsList=> InvoiceNumber
    Excel.WriteToExcel.WriteCell Instance: ExcelInstance Value: InvoiceNumber Column: 3 Row: FirstFreeRow
    Variables.RetrieveDataTableColumnIntoList DataTable: ExtractedPDFTables[0].DataTable ColumnNameOrIndex: 3 ColumnAsList=> AmountDue
    Excel.WriteToExcel.WriteCell Instance: ExcelInstance Value: AmountDue Column: 4 Row: FirstFreeRow
    Variables.IncreaseVariable Value: FirstFreeRow IncrementValue: 1
    END

     

    If I have answered your question, please mark my post as Solved.

    If you like my response, please give it a Thumbs Up.

     

    Regards

    Kaif

  • Rakesh_Tiwari Profile Picture
    8 on at

    Hi @Kaif_Siddique ,

    Thanks for your reply,

    Can you Pls check for this error?

    Rakesh_Tiwari_0-1677739565006.png

    Also let me know how to get method panel to select the methods

    Extracted data is coming like this i believe.

    Rakesh_Tiwari_0-1677747651669.png

     

  • Kaif_Siddique Profile Picture
    2,108 Super User 2024 Season 1 on at

    Could you share your flow screenshot and sample PDF files ? if still facing the issue.

     

    In my case, i have considered single page pdf file which has only one table (total 5 pdf files using for testing). Below is the sample pdf file.

    Kaif_Siddique_0-1677784786158.png

     

    And extracting the pdf table data to excel.

    Kaif_Siddique_1-1677785160809.png

     

    If I have answered your question, please mark my post as Solved.

    If you like my response, please give it a Thumbs Up.

     

    Regards

    Kaif

  • Rakesh_Tiwari Profile Picture
    8 on at

    Hi Kaif,
    Actually, the output was coming as text not as table, so i used split text action and then used regex to extarct the information from it.
    And that worked.

    But, thanks for all your effort. in future also i try posting my issue, pls try to answer them.

    Happy Automation

    Rakesh

  • momlo Profile Picture
    1,527 Super User 2024 Season 1 on at

    Hi @Rakesh_Tiwari 

    If you decide to extract text (not tables) - then use "parse text" with regex expressions to get your data.

    Examples of expressions based on your data:

     

     

    (?<=Billed To\s\s).+(?=.)

     

    momlo_1-1677941947341.png

     

     

    (?<=Invoice Number\s\s)\d+(?=.)

     

    momlo_2-1677942014696.png

     

     

     

    (?<=Amount Due \(INR\)\s\sRs.).+

     

    momlo_3-1677942110225.png

     

    If your documents are consistent, and always the same, it should play out just fine.

    However, sometimes extracting tables gives better results and then you need to work out how tables are extracted, and you need to see what table cell reference for which field.

     

    that's what you need to test and see what is better for your case.

     

     

     

  • takolota1 Profile Picture
    4,980 Moderator on at

    You can also now use this template to extract data from PDFs without Regex directly in a cloud flow using GPT: https://powerusers.microsoft.com/t5/Power-Automate-Cookbook/Extract-Data-From-PDFs-and-Images-With-GPT/td-p/2201345

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!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 589

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 284 Super User 2026 Season 1

Last 30 days Overall leaderboard