Skip to main content

Extract Worksheet from Excel in Power Automate

PDF4me Extract Worksheet from Excel action enables extraction of entire worksheets from Excel documents as structured JSON data in Power Automate with automatic header detection and flexible selection options. This powerful whole-worksheet extraction feature converts one or more worksheets to JSON format using the first row as column headers, with support for worksheet selection by name or index (or all worksheets by default), perfect for complete data export, multi-sheet processing, API integration, and comprehensive Excel-to-JSON transformation workflows across Microsoft 365.

Authenticating Your API Request

To access the PDF4me Web API through Power Automate, every request must include proper authentication credentials. Authentication ensures secure communication and validates your identity as an authorized user, enabling seamless integration between your Power Automate flows and PDF4me's powerful Excel worksheet extraction services.

Extract Worksheet from Excel Power Automate

Key Features

  • Complete Worksheet Extraction: Export entire worksheets as structured JSON data
  • Automatic Header Detection: First row automatically used as column headers
  • Flexible Selection: Extract by worksheet names, indexes, or all worksheets
  • Multi-Sheet Support: Extract multiple worksheets in a single operation
  • Structured JSON Output: Dictionary format with worksheet names as keys
  • Data Type Preservation: Maintains numbers, dates, booleans, and text types

Parameters

Complete list of parameters for the Extract Worksheet from Excel action. Configure these parameters to control worksheet extraction.

Important: Parameters marked with an asterisk (***) are required. Worksheet indexes use 0-based numbering (Index 0 = first worksheet).

ParameterTypeDescriptionExample
File Content***Base64Source Excel File Content
• Map Excel file from previous action output
• Supports Excel files from SharePoint, OneDrive, email attachments
• Can be dynamically retrieved from flow variables
• Must be valid Excel document (.xlsx, .xls formats)
[File Content from Get File]
File Name***StringExcel Document Name
• Specify Excel file name with extension (.xlsx, .xls)
• Used for processing and output file naming
• Must include proper file extension
• Supports dynamic naming from flow variables
data.xlsx
Worksheet NamesStringComma-Separated Worksheet Names
• List of worksheet names to extract
• Format: "Sheet1,Summary,Report"
Selection Logic: If provided → Extract those named worksheets. If both WorksheetNames and WorksheetIndexes provided → Extract worksheets matching EITHER (union). If NEITHER provided → Extract ALL worksheets
• Case-sensitive worksheet names
Employees,Sales
Worksheet IndexesStringComma-Separated Indexes (0-based)
• List of worksheet indexes to extract
• Format: "0,1,2" (Index 0 = first sheet, Index 1 = second sheet, etc.)
Selection Logic: If provided → Extract those indexed worksheets. If both parameters provided → Extract worksheets matching EITHER (union)
0-based indexing: Index 0 = first worksheet
0,2,4

Output

The PDF4me Extract Worksheet from Excel action returns comprehensive JSON output data for seamless Power Automate flow integration:

Table View

Response data in a structured table format:

ParameterTypeDescription
documentBase64JSON data as byte array (saved as .txt file)
FileNameStringOutput filename with .txt extension
SuccessBooleantrue if operation successful, false if failed
Error MessageStringError description (null if successful)
ErrorsArrayList of detailed error information (empty array if successful)

Common Error Messages

Understanding and troubleshooting errors helps ensure smooth Excel worksheet extraction workflows:

Error MessageCauseSolution
"Request is empty"Request object is nullProvide valid request object
"Document is empty"Document object is null or DocData is nullProvide valid Excel document
"Workbook contains no worksheets"Excel file has 0 worksheetsProvide valid Excel file with at least one worksheet
"Invalid worksheet selection"Worksheet name doesn't exist or index out of rangeUse valid worksheet names or indexes (0-based)
"Available worksheets in workbook (X total)"Informational message when worksheet selection validation failsReview worksheet names/indexes and use valid values from X available worksheets

Workflow Examples

The PDF4me Extract Worksheet from Excel action in Power Automate provides comprehensive workflow templates designed for real-world business scenarios:

Automated Multi-Worksheet to API Integration Workflow

Transform your data integration with complete workbook extraction and API feeding:

Complete Workflow Steps:

  1. Trigger: Excel workbook uploaded to SharePoint "Data Export" folder
  2. Get Excel File: Retrieve multi-sheet Excel from SharePoint
  3. Extract All Worksheets: Leave WorksheetNames and WorksheetIndexes empty
  4. Parse JSON: Convert document content to JSON object
  5. Loop Through Worksheets: Use Apply to each for worksheet keys
  6. Process Each Sheet: Extract worksheet name and data array
  7. Call API Per Sheet: HTTP POST each worksheet's data to different API endpoint
  8. Log Results: Record successful/failed API calls per worksheet
  9. Send Summary: Email admin with processing summary by worksheet

Business Benefits:

  • Integrates complete multi-sheet workbooks with APIs automatically
  • Processes different worksheets to different API endpoints
  • Provides structured JSON format for each worksheet
  • Eliminates manual multi-sheet data extraction and API posting

Industry Use Cases & Applications

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

Get Help