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 / Sharepoint get files i...
Power Automate
Unanswered

Sharepoint get files in a folder to extract text from PDFs

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Good afternoon

 

I would like to use Power Automate to examine each pdf in a folder and extract the text from each one and store it in an Excel file along with the filename. I want to use the manual action, Ai flow already within power automate.

I am utilizing this code, however, I need to change the manual trigger to new files, and I can create the final bit with excel.

What trigger can I use in order to capture a new pdf in a sharepoint folder, then pass the file content to the Ai stage below?

MyWeeLola_0-1687182063884.png

I look forward to hearing from you

Lola

 

Categories:
  • AlexEncodian Profile Picture
    4,409 Moderator on at

    @Anonymous 

    Use trigger conditions in the "when a file is created (properties only)" trigger. You can find these in the trigger under settings

  • sandeepstw Profile Picture
    312 Moderator on at

    Hi There,

     

    To achieve your desired workflow using Power Automate, you can follow these steps:

    1. Create a new flow in Power Automate and add a trigger for the SharePoint folder when a file is created or modified. Configure the trigger to point to the desired SharePoint folder containing the PDF files.

    2. Add an action to initialize a variable. Set the variable to store the file content and name, which will be used in subsequent steps. For example, create a variable named "PDFData" and set its initial value to an empty array.

    3. Add an "Apply to each" loop to iterate through each file in the SharePoint folder. This loop will be used to process each PDF file individually.

    4. Inside the loop, add an action to get file content. Use the SharePoint "Get file content" action and configure it to retrieve the content of the current file in the loop. Store the file content in a variable, such as "FileContent".

    5. Next, add an action to extract the text from the PDF using AI Builder. Search for the "AI Builder" action and choose the "Extract text from PDF" action. Configure the action to use the "FileContent" variable as the input for the PDF file content.

    6. Add an action to append to an array variable. Use the "Append to array variable" action and set the array variable to "PDFData". In the Value field, map the "FileName" property from the current file in the loop and the "ExtractedText" property from the previous AI Builder action.

    7. After the loop ends, add an action to create a new Excel table or append to an existing one. Configure the action to use the "PDFData" array variable as the input for the table data. Map the "FileName" and "ExtractedText" properties to the corresponding columns in the Excel table.

    8. Save and test your flow. Whenever a new PDF file is added or modified in the SharePoint folder, the flow will trigger, extract the text from each PDF, and store it in the Excel table along with the file name.

    Remember to adjust the actions and their configurations based on your specific environment and requirements.

     

  • yzhan253 Profile Picture
    2 on at

    Hi @sandeepstw , would you please provide screenshots to guild me through your steps? 

  • takolota1 Profile Picture
    4,980 Moderator on at

    @yzhan253 

     

    You could also copy the Convert to txt segment of this template to get the appropriate text for each page. If you don’t need the GPT action at the end, then you can just remove it & insert the text wherever you want it.

     

    https://powerusers.microsoft.com/t5/Power-Automate-Cookbook/Extract-Data-From-PDFs-and-Images-With-GPT/td-p/2201345

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
Mohsin Ali Profile Picture

Mohsin Ali 426

#2
11manish Profile Picture

11manish 349 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard