One of my colleagues works in an HR team, where they receive a large number of PDF files containing Employee details of their organization. They wanted to extract the Employee details that are present in a tabular format and store them in an Excel worksheet.
To simplify the process, without manually adding data, I suggested using Power Automate desktop flow to extract tables and save them to an Excel worksheet.
This tutorial will explain how to extract a table from a PDF file using Power Automate Desktop and display it in a message box. Additionally, I will cover how to extract tables from a PDF File and display them in an Excel spreadsheet in Power Automate Desktop.
Extract a Table from PDF using Power Automate Desktop [Display in Message Box]
To explain this example, I will use the PDF “Employee Details” in my local system.

Here are the steps to extract a table from a PDF file :
- Open the Power Automate desktop app-> Click on the + New button -> Select Flow -> Provide a name for the flow in the Create a flow dialogue box. Then, click on the Create button.

- Then, it will open a separate window where you can drag and drop the actions to the workspace designer.

- Under Actions pane, search for “Extract tables from PDF” action. Drag and drop it to the workspace.

- In the Extract tables from PDF action, set the below placed properties. Then, click on Save.
- PDF file: Upload the PDF file from your local desktop by clicking the Select file icon.
- Page(s) to extract: I will choose ‘Single’, as I have data table in single page.
- Single page number: Provide the page number.

- Then, drag and drop the “For each” loop into the workspace, so that it iterates over items in a table. The value retrieved will be stored in the CurrentItem variable.
- Value to iterate: Click on {x} -> Select variable from Excel.

- Inside the For each loop, search and add a “Display message” action to display the table data extracted from the PDF file. Set the properties and click on the Save button.
- Message box title: Give a name for a message box.
- Message to display: Click on {X} -> Expand CurrentItem variable -> Select .Data Table.
- Message box icon: Choose the Information option.

- Once it is done, save and run the flow. When the flow execution is completed, a message box displays the extracted table values. The screenshot below shows this.

The above steps will extract the tables from a PDF file to a message box using Power Automate Desktop.
However, sometimes, you may need to convert the extracted table to an Excel file. To do so, follow the steps below.
Check out Connect Power Automate Desktop to Cloud using Direct connectivity
Extract Tables from a PDF to Excel by Power Automate Desktop
In this section, let’s see how to extract tables from a PDF to an Excel worksheet using Power Automate desktop.
Below is a PDF file containing two tables with the data on different pages. You can see the GIF placed below..

I want to extract these two tables into separate Excel worksheets. To extract tables from a PDF file, you need to use the Extract tables from PDF action, where the row index of the extracted table starts with 0. Here, I have two tables in the PDF mentioned above, so the row index of the 2nd table will be 1.
As you already know, creating a flow in Power Automate desktop requires the steps outlined below.
- Drag and drop “Extract tables from PDF” action into workspace, set the below placed properties. Then, click on Save.
- PDF file: Click on {x} -> Select a pdf file from your local system.
- Page(s) to extract: Select the required option.
This action will produce a variable named ExtractedPDFTables.

- Drag and drop “Launch Excel” from the Action pane on the Flow designer workspace window. Configure the parameters below. Then, click on Save.
- Launch Excel: Select with a blank document option.
- Make instance visible: Select the toggle button.

- Next, add an action “Focus window”. Then, select By title and/or class option for the Find window mode parameter. Click the Save button.
- Window title: Choose Book1 – Excel option.

- After that, add a “Set window state” action. Set the properties below. Click on the Save button to add the action to the workspace.
- Find window mode: Select the By title and/or class option.
- Window title: Choose Book1 – Excel option.
- Window state: Select the Maximized option.

- Search for the variables under the Actions pane and drag and drop the “Set variable” action. Then, provide the information below. After that, click on the Save button.
- I have renamed the variable produced to TableNumber.
- Value: Enter the value to ‘0’.

- Search and add “For each” loop, so that it will loop through all the items. The value retrieved will be stored into currentItem variable. Tap on Save button.
- Value to iterate: Click on {X} -> Select ExtractedPDFTables variable.

- Inside the For each loop, drag and drop the “Add new worksheet” action. Provide below properties. Then, Save the action.
- Excel instance: By default, it will be selected.
- New worksheet name: Select TableNumber variable.
- Add worksheet as: Select Last worksheet option from drop-down.

- Then, add “Write to Excel worksheet” action. Configure the below properties. This action will add the column header values to Excel. Save the action.
- Value to write: Insert the below code
- Write mode: Select On currently active cell option.
%ExtractedPDFTables[TableNumber].datatable.ColumnHeadersRow%
- Next, add a “Get first free row on column from Excel worksheet” action. Enter the value of ‘1’ in the Column parameter. Here, it will produce FirstFreeRowOnColumn variable. Save the action.

- Now, add another “Write to Excel worksheet” action to add the table data. Set the required properties and save the action.
- Value to write: %ExtractedPDFTables[TableNumber].datatable%
- Write mode: Select On specified cell option.
- Column: Enter value as 1.
- Row: Choose FirstFreeRowOnColumn variable.

- In the final step, take the Increase variable action. This will make the loop rerun until a specific value is provided [Increase by 1]. I have taken a PDF with two tables, so I want to increase the variable value by 1. Click Save.

- Now, the flow is ready to save. Click on the Save icon and run the flow.
When the flow runs, you can see the row index of an extracted table in the ExtractPDFTable variable. For the zero index, the flow will execute the first table, and for the 1-row index, the flow will execute the second table. If you have more tables in your PDF, increase the set variable number.

After the flow executes successfully, you can see that the tables from the PDF file are extracted and stored in two different Excel worksheets.


This is all about how to extract tables from a PDF file using Power Automate Desktop.
In this tutorial, I have explained how to extract tables from a PDF file using Power Automate Desktop (PAD). I hope you found this article helpful. Please let me know about your suggestions in the comments section.
You may also like the following tutorials:
- Create a Word Document From a Template in Power Automate
- Export Power BI Report to Excel using Power Automate
- Power Automate Desktop SharePoint Get items Filter Query
- Update Items in a SharePoint List in Power Automate Desktop

After working for more than 18 years in Microsoft technologies like SharePoint, Microsoft 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (12 times). I have also worked in companies like HP, TCS, KPIT, etc.