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 / Populating a pdf form ...
Power Automate
Unanswered

Populating a pdf form with from a table in excel or power bi using desktop power automate

(0) ShareShare
ReportReport
Posted on by 4

Hello, Is it possible to take the data from each row of a power bi query or excel table table and then use this data to fill in a pdf form, using power automate?

 

======sample table

=====number -- direction --

row1 => 123 ------- up --

row2 => 456 ------- down --

=the pdf form would have two fields that are fillable:  col1 is "number" and col2 is "direction."

==I realize that this can be done with online solutions such as with a sharepoint list or, for instance, with smartsheet but I am wondering if it can also be done with the desktop version of power bi query or excel and desktop power automate. 

 

I posted this question in the power bi forum and it was suggested that I ask the question here, in the power automate forum.

Thank you, Steve

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    The short answer is yes.  You can pull in excel table data and reference the data (as text) to populate text fields.  The hardest part will be identifying the text fields which should be difficult as long as they can be picked up by Windows UI elements or gotten to via "Send Keys" {Tab}.  Good luck!

  • selster Profile Picture
    4 on at

    Since in the excel table, since each row has identical columns, and the column name correspond to the filed names in the fillable pdf form,  I thought that there might be a way to use some kind of for loop, go row by row, scooping up each field, saving it to a variable, and then, switching to adobe, adn stuffing the corresponding field name.  But I am not sure how to do this with a loop let alone access the excel row values??

  • yoko2020 Profile Picture
    495 on at

    This is my code for handling fillable pdf using Power Automate Desktop and Powershell action using itextsharp.dll

     

    Code to get field name inside pdf

     

    $Template_form = '%File_PdfTemplate%'
    $output_file = '%PathFileToSigned%'
    $dllfile = 'Z:\Bots\itextsharp.dll'
    
    [Reflection.Assembly]::UnsafeLoadFrom($dllfile)
     
    ## Instantiate the PdfReader object to open the PDF 
    [iTextSharp.text.pdf.PdfReader]::unethicalreading = $true
    $reader = New-Object iTextSharp.text.pdf.PdfReader -ArgumentList $Template_form
     
    ForEach ($FieldName in $reader .AcroFields.Fields.Key) {
    
    $taik2 = $FieldName
    
    Write-Host "$taik2`: " -NoNewline
    }
    $reader.Close()

     

     

     

    This is sample code for filling the pdf, stamp/flattened and save as new pdf file.

     

    $Template_form = '%File_PdfTemplate%'
    $output_file = '%PathFileToSigned%'
    $dllfile = '%File_ItextSharp%'
     
    $customer = '%CompanyName%'
    $address = '%CompanyAddress%'
    $customercontact = '%CustomerContact%'
     
     
    [Reflection.Assembly]::UnsafeLoadFrom($dllfile)
     
    ## Instantiate the PdfReader object to open the PDF 
    [iTextSharp.text.pdf.PdfReader]::unethicalreading = $true
    $reader = New-Object iTextSharp.text.pdf.PdfReader -ArgumentList $Template_form
     
    ## Instantiate the PdfStamper object to insert the form fields to 
    $stamper = New-Object iTextSharp.text.pdf.PdfStamper($reader,[System.IO.File]::Create($output_file)) 
    $stamper.FormFlattening = $true
     
     $pdf_fields =@{ 
     'customer' = $customer; 
     'address' = $address; 
     'customercontact' = $customercontact; 
     
     } 
     
     foreach ($field in $pdf_fields.GetEnumerator()) { 
     $stamper.AcroFields.SetField($field.Key, $field.Value) | Out-Null 
     } 
     
    ## Close up shop 
     
    $stamper.Close()
    $reader.Close()

     

     

  • Lyndaleader Profile Picture
    7 on at

    there is a new option in 2023, much simpler, no coding required.

     

    https://appsource.microsoft.com/pl-pl/product/office/wa200005545?tab=overview&exp=kyyw

     

    5-min video walkthrough: https://www.youtube.com/watch?v=w6h7s8COkXA

     

    Hope this helps!

  • johnsmith3 Profile Picture
    3 on at

    Good to know this Power PDF Filler, thanks!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 249 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 202

#3
David_MA Profile Picture

David_MA 180 Super User 2026 Season 2

Last 30 days Overall leaderboard