How to Extract PDF Text and Rename Files with Power Automate
Question details
The user needs to extract specific text, such as a team name, from a PDF form and use that extracted text to automatically rename the file or move it into a corresponding SharePoint folder.

- Product
- Power Automate
- Device & OS
- not provided
- Scenario
- Automating SharePoint document organization by pulling dynamic metadata (like team names) directly from uploaded PDF forms.
- Observed behavior
- Files currently require manual renaming or routing because folder names do not always strictly match the text provided inside the PDF forms.
Ensure you have an active Microsoft Power Automate license with available AI Builder credits, as extracting text from PDFs requires premium AI Builder actions.
Use AI Builder to Extract Text and Organize Files
This solution uses the AI Builder connector in Power Automate to read PDF text, convert it to a string, and dynamically rename or move the file in SharePoint.
Because the team names inside the PDFs might not perfectly match the SharePoint folder names (e.g., 'Arizona Blue' vs. 'Arizona Baseball Blue'), you may need to add condition mapping or simply append the extracted text to the file name instead of relying on exact folder matches.
In your Power Automate flow, use the SharePoint 'Get file metadata' or trigger action to retrieve the unique identifier of the uploaded PDF.
Add the SharePoint 'Get file content' action and pass the file identifier to fetch the actual PDF data.
Add the AI Builder action 'Recognize text in an image or a PDF document'. Pass the file content from the previous step into this action.
AI Builder returns an array of text lines. Use a 'join' expression in a 'Compose' action to convert the returned text array into a single, workable string.
Add a 'Move file' or 'Update file properties' action. Use the extracted string (the team name) as a dynamic value to rename the file or define the destination SharePoint folder path.

Looking for an easier way to manage PDFs and Office files?
While Power Automate handles complex automated SharePoint routing, WPS Office offers a robust, free alternative for daily document and PDF management. It is lightweight, fully compatible with Microsoft formats, and provides an intuitive interface for all your editing needs.

Frequently Asked Questions
Why do I need AI Builder credits to extract PDF text in Power Automate?
Extracting unstructured text from an image or PDF requires Optical Character Recognition (OCR) and machine learning capabilities. In Power Automate, these advanced features are provided by AI Builder, which is a premium connector requiring specific licensing credits.
How can I handle mismatched folder names in my Power Automate flow?
If the extracted text (like 'Arizona Blue') doesn't exactly match the SharePoint folder ('Arizona Baseball Blue'), you can use a 'Switch' or 'Condition' control in your flow to map specific extracted values to the correct folder path, or simply append the extracted text to the file name instead of moving it.
How do I convert the AI Builder text array into a readable string?
AI Builder returns extracted text as an array of individual lines. You can convert this into a single string by using the join() expression in a Power Automate Compose action, for example joining the results with a space character.




