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 Tables from PD...
Power Automate
Suggested Answer

Extract Tables from PDF - not fixed columns

(0) ShareShare
ReportReport
Posted on by 2
I have a PAD flow created to extract values from Tables in a PDF file using the action Extract Tables from PDF. Though it is a PDF table and fixed position, the extraction table columns and roles are not fixed when returning. As a result, it is always a challenge to read the desired value from the data table for further data manipulation. Is there a better way to resolve this? 
 
 
 
 
 
 
 
 
These are the two tables i extract from the PDF file. The columns and rows in the extraction result table at times varies. 
 
Thanks in advance 
P20
I have the same question (0)
  • Suggested answer
    VishnuReddy1997 Profile Picture
    2,656 Super User 2026 Season 1 on at
     
    If the column names are same try to Retrieve the Required column Data into list as shown in below.
     
     
    If the column names are also different then you need you either AiBuilder or Azure Document Intelligence.
     
    Regards,
    Vishnu Reddy
  • Suggested answer
    Riyaz_riz11 Profile Picture
    4,150 Super User 2026 Season 1 on at
    Hi,
     

    Solution 1: Text-Based Extraction with RegEx (Recommended)

    Instead of table extraction, use text extraction with pattern matching:

      
    // Extract text from PDF
    PDFActions.ExtractTextFromPDF File: PDFFile ExtractedText=> ExtractedText
    
    // Use RegEx to find specific patterns
    Text.ParseTextWithRegularExpression.ParseForFirstMatch Text: %ExtractedText% RegularExpressionPattern: '(\d{1,2},\d{3}\s+P)\s+(\d{1,3},\d{3})' IgnoreCase: True Match=> CoasterMatch
    
    // Extract specific values using known patterns
    Text.ParseTextWithRegularExpression.ParseForFirstMatch Text: %ExtractedText% RegularExpressionPattern: '11,000\s+P\s+(\d{1,3},\d{3})\s+(\d{1,3},\d{3})' IgnoreCase: True Match=> ElevenThousandMatch
    
    // Access extracted values
    SET EastValue TO %ElevenThousandMatch.Groups[1].Value%
    SET WestValue TO %ElevenThousandMatch.Groups[2].Value%
     

    Solution 2: Smart Table Processing with Headers

    Process the extracted table by finding headers first:

    // After extracting table
    PDFActions.ExtractTablesFromPDF File: PDFFile ExtractedTables=> ExtractedTables
    
    // Find header row containing "East" and "West"
    LOOP FOREACH CurrentRow IN %ExtractedTables[0]%
        IF %CurrentRow% CONTAINS 'East' AND %CurrentRow% CONTAINS 'West' THEN
            SET HeaderRowIndex TO %LoopIndex%
            // Find column positions
            LOOP FOREACH CurrentCell IN %CurrentRow%
                IF %CurrentCell% = 'East' THEN
                    SET EastColumnIndex TO %LoopIndex%
                END IF
                IF %CurrentCell% = 'West' THEN
                    SET WestColumnIndex TO %LoopIndex%
                END IF
            END LOOP
            EXIT LOOP
        END IF
    END LOOP
    
    // Now extract data using found positions
    SET EastValue TO %ExtractedTables[0][HeaderRowIndex + 1][EastColumnIndex]%
    SET WestValue TO %ExtractedTables[0][HeaderRowIndex + 1][WestColumnIndex]%
     
    If I have answered your question, please mark it as the preferred solution ✅ . If you like my response, please give it a Thumbs Up 👍.
    Regards,
    Riyaz
     

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!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 959

#2
Valantis Profile Picture

Valantis 872

#3
Haque Profile Picture

Haque 589

Last 30 days Overall leaderboard