Extract Worksheets from Excel in Power Automate
PDF4me Extract Worksheets is a Power Automate action that converts one, several, or all worksheets from an Excel workbook into structured JSON, using each sheet's first row as column headers. Use it to feed worksheet data into an API, a database import, or a JSON archive without writing any parsing code.
What this action does
PDF4me Extract Worksheets takes an Excel file plus an optional worksheet selection and returns a JSON object with one key per extracted worksheet name. Each key holds an array of row objects built from that sheet's header row and data rows, with numbers, dates, booleans, and text preserved in their native JSON types.
Authenticating Your API Request
To access the PDF4me Web API through Power Automate, every request must include a valid API key. Authentication validates your identity and enables the connector to reach PDF4me's Excel worksheet extraction service from your flow.
Important Facts You Should Not Miss

Map File Content and File Name from a prior action, then set Worksheet Names and/or Worksheet Indexes, or leave both blank to extract every sheet.
Parameters
Required: File Content and File Name must always be provided. Worksheet Names and Worksheet Indexes are both optional; leaving them blank extracts all worksheets.
| Parameter | Required | What it does | Example |
|---|---|---|---|
| File Content | Required | Base64 or buffer content of the source Excel file, typically mapped from a prior action like SharePoint or OneDrive Get File Content. | [File Content from Get File] |
| File Name | Conditional | Name of the Excel file including its extension. Shown as a plain field in the connector UI and used for processing and output naming; supply it even though the connector does not mark it with an asterisk. | data.xlsx |
| Worksheet Names | Optional | Comma-separated list of worksheet names to extract. Case-sensitive, and combines with Worksheet Indexes as a union when both are set. | Employees,Sales |
| Worksheet Indexes | Optional | Comma-separated list of 0-based worksheet indexes to extract, for example "0,2,4" for the first, third, and fifth sheets. | 0,2,4 |
What Does Extract Worksheets Return?
| Field | Type | What it contains |
|---|---|---|
document | Base64 | The extracted JSON data as a byte array, saved as a .txt file, keyed by worksheet name. |
FileName | String | Output file name with a .txt extension. |
Success | Boolean | true when extraction completed, false if the request failed validation or processing. |
Error Message | String | Description of what went wrong, null when Success is true. |
Errors | Array | Detailed error entries, empty when Success is true. |
- JSON Response
- Error Response
{
"document": "[Base64 JSON Data]",
"FileName": "report.txt",
"Success": true,
"ErrorMessage": null,
"Errors": []
}
Decoded document content example:
{
"Employees": [
{"Name": "John Doe", "Age": 30, "Department": "IT"},
{"Name": "Jane Smith", "Age": 28, "Department": "HR"}
],
"Sales": [
{"Product": "Widget", "Units": 100, "Revenue": 2500.00},
{"Product": "Gadget", "Units": 75, "Revenue": 1875.00}
]
}
{
"document": null,
"FileName": null,
"Success": false,
"ErrorMessage": "Invalid worksheet selection",
"Errors": [
{
"Code": "WORKSHEET_ERROR",
"Message": "Worksheet 'NonExistent' not found. Available worksheets in workbook (3 total)"
}
]
}
Common Error Messages
| Error Message | Cause | Solution |
|---|---|---|
Request is empty | Request object is null. | Provide a valid request object. |
Document is empty | Document object is null or DocData is null. | Provide a valid Excel document. |
Workbook contains no worksheets | Excel file has 0 worksheets. | Provide a valid Excel file with at least one worksheet. |
Invalid worksheet selection | Worksheet name does not exist or index is out of range. | Use valid worksheet names or 0-based indexes. |
Available worksheets in workbook (X total) | Informational message appended when worksheet selection validation fails. | Review worksheet names or indexes and use valid values from the X available worksheets listed. |
How Do I Set Up Extract Worksheets in Power Automate?
- Add PDF4me → Extract Worksheets to your Power Automate flow.
- Map File Content and File Name from a previous action, such as SharePoint or OneDrive Get File Content.
- Set Worksheet Names, Worksheet Indexes, both, or leave both blank to extract every worksheet.
- Run the flow. Each selected worksheet's first row becomes the JSON keys, and the result returns as
document, a Base64-encoded JSON object keyed by worksheet name.
When Should I Use Worksheet Names Versus Worksheet Indexes?
Use Worksheet Names when the target sheets have stable, known names, such as "Summary" or "ClientData", since the selection stays correct even if the sheet order changes. Use Worksheet Indexes when a flow generates workbooks with predictable sheet order but variable names. Setting both extracts the union of the two selections, so overlap between them does not duplicate a worksheet in the output.
Typical Setups
Workflow ExamplesCommon Power Automate flow patterns using Extract Worksheets from Excel.
- A flow triggers when a multi-sheet Excel workbook is uploaded to a SharePoint "Data Export" folder.
- Get File Content retrieves the workbook.
- Extract Worksheets runs with both Worksheet Names and Worksheet Indexes left blank to convert every sheet.
- Parse JSON processes the result, and an Apply to each loop posts each worksheet's data to its own API endpoint.
- A recurrence trigger runs a monthly archival flow.
- Get File Content retrieves completed project Excel files from SharePoint.
- Extract Worksheets converts each workbook to JSON with all sheets included.
- The JSON output is stored to Azure Blob Storage or SharePoint alongside the original archived file.
- A Microsoft Forms submission requests a client-specific data export.
- Get File Content retrieves the master workbook from a secure SharePoint library.
- Extract Worksheets runs with Worksheet Names set to only the sheets the client is authorized to see, for example "Summary,ClientData".
- The resulting JSON is emailed to the requestor, leaving unrelated internal sheets out of the export entirely.
Practical Tips
Cheat Sheet
| Field | Value |
|---|---|
| Action | Extract Worksheets |
| File Content | Mapped from a prior file-retrieval action |
| File Name | e.g. data.xlsx |
| Worksheet Names | Comma-separated, case-sensitive, or blank |
| Worksheet Indexes | 0-based, comma-separated, or blank |
| Blank + blank | Extracts all worksheets |
| Both filled | Union of name matches and index matches |
| Output | document (Base64 JSON, .txt), FileName, Success, Error Message, Errors |
Common Questions
Industry Use Cases & Applications
- IT & System Integration
- Finance & Accounting
- Sales & Marketing
- Human Resources
- Operations & Supply Chain
- Education & Research
IT & System Integration Use Cases
- System Migration: Export entire Excel workbooks as JSON for system migrations
- Multi-API Integration: Send different worksheets to different API endpoints
- Data Backup: Create JSON backups of multi-sheet Excel files
- Cloud Migration: Convert Excel workbooks to JSON for cloud storage
Finance & Accounting Use Cases
- Multi-Period Export: Extract all worksheet tabs (monthly periods) to JSON
- GL Migration: Export chart of accounts and transactions from multi-sheet Excel
- Financial Consolidation: Combine data from multiple worksheet tabs
- Audit Exports: Extract complete workbooks for audit review
Sales & Marketing Use Cases
- Multi-Region Data: Extract regional sales data from different worksheet tabs
- Campaign Analytics: Export campaign results from multi-sheet reports
- Lead Database Export: Convert lead tracking worksheets to JSON
- Territory Data: Extract territory-specific data from worksheet tabs
Human Resources Use Cases
- Employee Data Export: Extract all HR worksheets (employees, benefits, payroll)
- Multi-Department Reports: Export department data from separate worksheets
- Payroll Migration: Convert payroll worksheets to JSON for new system
- Benefits Enrollment: Extract enrollment data from multiple worksheet tabs
Operations & Supply Chain Use Cases
- Inventory Export: Extract warehouse inventory from multiple worksheet tabs
- Multi-Location Data: Export location-specific data from worksheets
- Supply Chain Migration: Convert supplier and product worksheets to JSON
- Production Reports: Extract production data from multi-shift worksheets
Education & Research Use Cases
- Multi-Course Data: Extract course data from different worksheet tabs
- Student Records Export: Convert student records from multiple worksheets
- Research Data: Export experimental data from multi-tab worksheets
- Grade Books: Extract grade data from multiple class worksheets