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 / Copilot Studio / Accessing attached fil...
Copilot Studio
Suggested Answer

Accessing attached file's content

(0) ShareShare
ReportReport
Posted on by 8
Hi,

I'm creating an agent that analyzes text that the user uploads to the agent. What would be the best way to access the content of an attached text file?
 
Here is an example of a topic that triggers when a file is attached, and the Message node outputs First(System.Activity.Attachments).Value.
But this only gives a download link to the attached file. The download link, however, contains the text inside the file in base64 format.
For example, when I attached a text file with "text" written inside it copying the download link gives data:text/plain;base64,dGV4dA==
 
 
When the user uploads a .txt file, is it possible to save the content into a variable?
Or should I use a OneDrive connector and how? 
Categories:
I have the same question (0)
  • Suggested answer
    S-Venkadesh Profile Picture
    1,184 Super User 2026 Season 1 on at

    One reliable way to extract file content is:

    1. Use a Question node to upload the file.
    2. Use a Prompt node to extract the file content (you can use the code interpreter if it’s an Excel file).
    3. Use a Message node to return the response.

    I tested this with a PDF, and it worked well.

    I hope this information helps! If it does, please consider giving a 👍.
    Best regards,
    S-Venkadesh
  • CU28100843-0 Profile Picture
    8 on at
     
    Thanks for the reply. Unfortunately this is not what I'm looking for. I have tried your solution, but the problem is that it only accepts image files and PDFs. The user having to convert the text files into PDF first makes the process very inefficient. Also, I have noticed that the prompt node seems to read text from pdfs using OCR (image to text), which sometimes messes up formatting and causes the model to time out on larger files.
     
    I specifically need to extract the content of a .txt file.
  • S-Venkadesh Profile Picture
    1,184 Super User 2026 Season 1 on at
    Understood. If your concern is support for .txt files, you can enable the Code Interpreter in the prompt. Once it’s enabled, you’ll be able to upload .txt files.
     
    Prompt> Settings > Enable Code interpreter

  • CU28100843-0 Profile Picture
    8 on at
    @S-Venkadesh that's interesting. Turning on the code interpreter does allow for more file types to be uploaded, but it still seems to be missing .txt. It additionally allows .XLSX, .DOCX, and .PPTX for some reason.
     
  • Suggested answer
    S-Venkadesh Profile Picture
    1,184 Super User 2026 Season 1 on at
     
    If uploading a .txt file isn't working, verify that file uploads are enabled in your settings. You can find it under:
    Settings → Generative AI → File processing capabilities → File uploads (toggle ON).
     

     
     
    I hope this information helps! If it does, please consider giving a 👍.
    Best regards,
    S-Venkadesh

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 > Copilot Studio

#1
Valantis Profile Picture

Valantis 813

#2
Vish WR Profile Picture

Vish WR 313

#3
Haque Profile Picture

Haque 271

Last 30 days Overall leaderboard