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 / pass attachment to cop...
Copilot Studio
Suggested Answer

pass attachment to copilot

(1) ShareShare
ReportReport
Posted on by 2
how to pass atchment from power automate to copiot studio agent ?
Categories:
I have the same question (0)
  • Suggested answer
    Beyond The Platforms Profile Picture
    165 on at
    Hi,
    to pass an attachment from Power Automate to a Copilot Studio agent, use the Return value(s) to Power Virtual Agents action, passing file data as a Base64 string in a strict JSON format ({ "name": "filename", "contentBytes": "base64string", "contentType": "mime/type" }).
     
    Alternatively, save files to SharePoint/OneDrive and pass the file path/URL to the agent for processing.
     
    Hope this helps!
    Paolo


    Did this solve your issue? → Accept as Solution
    👍 Partially helpful? → Click "Yes" on "Was this reply helpful?" or drop a Like!


    Want more tips on Power Platform & AI? Follow me here:

    🔗 LinkedIn: https://www.linkedin.com/in/paoloasnaghi/
    ▶️ YouTube: https://www.youtube.com/@BeyondThePlatforms
    📸 Instagram: https://www.instagram.com/beyond_the_platforms/
    🌐 Website: https://www.beyondtheplatforms.com/


     
  • Suggested answer
    Sayali Profile Picture
    Microsoft Employee on at
    Hello,
    Copilot Studio agents cannot accept file attachments programmatically from Power Automate; only interactive uploads are supported. For automation scenarios, agents must access files via SharePoint/OneDrive references or tool calls.

    You cannot pass a file or binary attachment directly from Power Automate to a Copilot Studio agent using the “Execute agent and wait → Attachments” field. Although the UI suggests this should work, it is not supported for Copilot Studio agents. The attachments schema comes from Bot Framework (Activity.attachments), but Copilot Studio does not support programmatic file ingestion through this mechanism. When users upload files via drag-and-drop in chat, the file goes through a Microsoft-managed ingestion pipeline (upload, virus scan, chunking, indexing), and only a secure reference ID is passed to the agent. When Power Automate sends raw base64 or binary content, that ingestion pipeline is bypassed, so the runtime rejects the file or falls back silently.

    The supported pattern is to send a file reference—not the file itself. The recommended approach is to store the document in SharePoint or OneDrive, then pass metadata (such as file name, URL, or item ID) to the agent. The agent can then retrieve and analyze the file securely. Another reliable approach is to let the agent call a Power Automate flow or connector to fetch the document when needed. For autonomous scenarios, a document landing in SharePoint should trigger a flow that passes the file URL to the agent for processing, rather than pushing binary content into it.
    Unsupported approaches include sending base64 content, using contentBytes, chunking the file into prompt text, or converting PDFs to raw text before sending to the agent. Copilot Studio restricts direct binary ingestion by design to enforce security, scanning, tenant isolation, and permissions.


     
  • DZ-27021321-0 Profile Picture
    12 on at
    Hello @Sayali
     
    Your response was very usefull for the situation i'm facing atm.
    I just have a curiosity that maybe you are able to clarify.
    I have an agent that should help me analyze incoming orders that i receive in mails.
    Passing many files to the agent with the trigger "when an email is received" seems not to work fine. For this reason i thought to upload all the files to SharePoint and just pass the links to the agent.
    I have this pdf file that is a scan of a page, so technically it's an image converted to pdf.
    When the agent try to read the file from SharePoint, it respond me that it tried with OCR to read the file but no clear data was found.
    Instead if I upload the file to the agent via copilot studio chat and ask to analyze it..... It can read and output all the data perfectly.
    How can I mimic the upload file in chat programmatically?
     
    Thanks
  • Suggested answer
    Sayali Profile Picture
    Microsoft Employee on at
    Hello  ,
    when you upload a file directly in chat, it uses advanced multimodal processing with strong OCR and layout understanding, which works well even for scanned PDFs, whereas files accessed via SharePoint links are treated as knowledge sources and go through a more limited text extraction pipeline with weaker OCR, often failing on image-based PDFs. Currently, there’s no supported way to programmatically replicate the “chat upload” behavior, so the recommended approach is to preprocess files before sending them to the agent—using AI Builder OCR or Azure Document Intelligence to extract text or structured data, and then passing that output to the agent for analysis. In practice, this means using Copilot as a reasoning layer while handling document parsing separately, which results in more reliable and production-ready solutions.

    How can I mimic chat upload programmatically?
    👉 You cannot directly mimic it today.
     

    But you can achieve same (or better) results by:

    • Pre-processing files with OCR (AI Builder / Azure DI)
    • Passing extracted text to the agent

     

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 704

#2
Vish WR Profile Picture

Vish WR 249

#3
Haque Profile Picture

Haque 244

Last 30 days Overall leaderboard