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 / How to convert SharePo...
Power Automate
Answered

How to convert SharePoint file to text in Power Automate for ChatGPT API?

(1) ShareShare
ReportReport
Posted on by 31

I have a flow in Power Automate Cloud flow that runs when a new item is created in a SharePoint library. The flow works and triggers correctly.

My goal is to summarize the content of the uploaded file using the ChatGPT API. However, the file content I receive from SharePoint is in binary format, and the ChatGPT API does not accept binary input.

Is there a way to convert the binary file content (such as PDF or DOCX) into plain text within Power Automate so that it can be sent to the ChatGPT API?

I would prefer a solution that does not require any premium connectors. Has anyone implemented something similar or found a workaround using standard Power Automate actions?

Any guidance or examples would be appreciated.

Categories:
I have the same question (0)
  • Verified answer
    deepakmehta13a Profile Picture
    369 on at

    Hi,

    In Power Automate, when you use Get file content from SharePoint, the file is returned in binary format. Since APIs like the ChatGPT API expect text, the file content needs to be converted to readable text before sending it in the request.

    The exact approach usually depends on the file type.

    For PDF files, Power Automate does not currently have a standard action that directly extracts text from a PDF without using AI Builder or another premium connector. Because of that, people usually use AI Builder, a third-party connector, or an external service to extract the text.

    For DOCX files, it’s a little different. A DOCX file is technically a ZIP package containing XML files, and the actual document text is inside a file called document.xml. In theory the text can be extracted from there, but doing that purely inside Power Automate with standard actions can be difficult.

    If you want to stay with standard connectors, one approach is something like this:

    1. Trigger – When a file is created in SharePoint

    2. Get file content

    3. Process or convert the file depending on whether it is PDF or DOCX

    4. Send the extracted text to the ChatGPT API using an HTTP action

    Another option, if you control the document format, is to save files as plain text or HTML first. Those formats are much easier to read and send directly to an API.

    If premium connectors are available, the process becomes easier. You could use AI Builder – Extract text from documents, or connectors like Encodian or Adobe PDF Services to extract text from PDF or DOCX files. These actions return the text output, which can then be passed directly to the ChatGPT API.

    In short, Get file content will give you the file, but converting PDF or DOCX to plain text usually requires AI Builder, a premium connector, or an external service to extract the text before sending it to ChatGPT.

    Hope this helps. If this helps resolve your issue, please consider marking the response as Verified so it may help others facing a similar scenario.

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard