web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / How to access file att...
Copilot Studio
Suggested Answer

How to access file attachment content (bytes or base64) in Power Virtual Agents / Copilot Studio?

(5) ShareShare
ReportReport
Posted on by 12

Hi all,

I'm building a Copilot (Power Virtual Agent) that accepts file attachments from the user. The System.Activity.Attachments object in Copilot gives me a file reference in this format:

  • Attachments - [{"Content":{"$kind":"FileDataValue","value":{"$kind":"ConversationFileReference","value":"7d6ea396-512f-482e-b122-1d32a2861ec6"}},"ContentType":"text/plain","Name":"sample_graph_model.cypher","Value":{"$kind":"FileDataValue","value":{"$kind":"ConversationFileReference","value":"7d6ea396-512f-482e-b122-1d32a2861ec6"}}}]
  • Channel data - {"attachmentSizes":[2996],"clientActivityID":"1hoju9ladx2","enableDiagnostics":true,"testMode":"Text"}

I need to pass this file (as contentBytes or base64 string) to a Power Automate flow, or access the content directly in Copilot logic. However, I'm running into these issues:

  • Power Automate file input fails with ConversationFileReference type — expects actual contentBytes

  • BlobToText or similar conversions are not supported in Copilot expressions

  • I don’t see any method to resolve this file reference to actual file content

 

What I'm trying to achieve:

  • Let user upload a file via Copilot (Teams or Web)

  • Read the content (as bytes/base64 string or plain text)

  • Pass it to Power Automate or process it directly

 

Questions:

  1. How can I access the file content from System.Activity.Attachments[x].Value inside Copilot?

  2. Is there any way to convert ConversationFileReference into actual contentBytes?

  3. Can Power Automate retrieve file content from this reference automatically?

  4. Is there an API endpoint or Graph call required to resolve this reference?


  5.  

Thanks in advance for any guidance!

Categories:
I have the same question (20)
  • MS-24090945-0 Profile Picture
    2 on at
    Hi, Hope it is not too late for answer.
     
    I have been facing the same problem lately and in the end I found a way to obtain base64 string using power autome flow.
     
    first of all you have to add "Question" in which you expect a File datatype, next you have to click the three dots, open properties -> entity recognition and check Include metadata. 
     
     
     
    Next you have to set up a Flow:
     
    This flow has one input parameter of File type, using the compose function you are able to retrive base64 string using this formula: 
    triggerBody()?['file']?['Content']
     
    And to get the base64 back to agent (or any other flow) you just use this formula:
     
    outputs('Compose')
     
     
    The last thing is the usage of the flow you just created
    you use this formula to send the file into the flow
     
    First(System.Activity.Attachments)
     
     
    I was facing this issue for a 5 days and found this solution in youtube comment
    I hope this help you
     
     
     
     
  • Suggested answer
    Romain The Low-Code Bearded Bear Profile Picture
    2,397 Super User 2026 Season 1 on at
    Hello, thanks for so many detail :) it seem this very old post came back to top of the forum without answer, with 17 people intersting in the answer, 
     
    i will try to answer to all since i worked a lot with this subject and will share what i doo.
     
    First : you use function "first()" to get the element, wich in many use case is enough for only one document. Good.
    Then you wana get all attachment : it's  a little tricky, there is a preview answer At the moment : the loop tool inside topic, here is a screenshot
     
     
    you will use it to loop through all attachment ! work very well :) if you don't have it, you need to have a free preview environnement (at the creation of a new environnement if you choose North USA you will have a new checkbox to enable preview feature)
     
    then for the content i use : First(System.Activity.Attachments).Content and work very well with tool like AI builder since it's seen as a blob (In power Power Automate AI Builder ask for contentBytes, in Topic of copilot studio it ask for Blob : both work)
     
    hope this will help people wich work with it :)

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!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 298

#2
chiaraalina Profile Picture

chiaraalina 108 Super User 2026 Season 1

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 94 Moderator

Last 30 days Overall leaderboard