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 / Send file from copilot...
Copilot Studio
Suggested Answer

Send file from copilot studio to power automate

(0) ShareShare
ReportReport
Posted on by 2

Hi everyone,

I have developed a support bot in Copilot Studio that allows users to attach files to a ticket. The current process is as follows:

  1. The bot requests a file from the user.

  2. A Power Automate flow receives the file, uploads it to OneDrive, and generates a sharing link to be added as an interaction in the ticket.

The Issue:
While the Power Automate trigger is configured to receive a File type, Copilot Studio sends this same object as a Record type. This discrepancy is causing a TriggerInputSchemaMismatch (BadRequest) error.

Even when attempting to use formulas like First(System.Activity.Attachments), the mismatch remains. Has anyone developed a workaround or a process to fix this incompatibility so that Power Automate can correctly ingest the file?

Best regards,

Gabriel Hiago de Sousa

Screenshot_6.png
Screenshot_7.png
Screenshot_8.png
I have the same question (0)
  • Suggested answer
    Beyond The Platforms Profile Picture
    171 on at
    This is a fairly common issue with the Copilot Studio / Power Automate integration when handling attachments. The core of the problem is that Copilot Studio passes attachments as Record objects (with properties like name, contentUrl, contentType), while Power Automate expects a native File type.
    Here is the most reliable solution:
     
    Solution: Pass the file URL instead of the file object directly

    Rather than trying to pass the file object directly, pass the Record's properties as separate text parameters to the flow, and then let Power Automate download the file via HTTP.

    Step 1 — Modify the Power Automate trigger

    In the flow, change the trigger from "Run a flow from Copilot Studio" with a File input to one with these Text inputs instead:
    fileUrl (Text) → the content URL of the file
    fileName (Text) → the name of the file
    fileContentType (Text) → the MIME type
     
    Step 2 — Modify Copilot Studio

    In the node that calls the flow, pass the properties by extracting them from the attachment object:
    fileUrl         = First(System.Activity.Attachments).contentUrl
    fileName        = First(System.Activity.Attachments).name
    fileContentType = First(System.Activity.Attachments).contentType

    Step 3 — Download the file via HTTP in Power Automate

    Add an HTTP action to retrieve the binary content:
    Method: GET
    URI:    @{triggerBody()['fileUrl']}
     If the file is hosted on Teams/SharePoint, the URL may require authentication. In that case, use the HTTP with Azure AD connector or SharePoint - Get file content using path, depending on where the file is stored.
     
    Step 4 — Upload to OneDrive

    Use the OneDrive for Business - Create file action:
    Folder Path:  /Attachments/Tickets
    File Name:    @{triggerBody()['fileName']}
    File Content: @{body('HTTP')}   ← output from the HTTP step

    Step 5 — Generate the sharing link

    Add OneDrive for Business - Create share link with type View or Edit according to your needs, and return the URL as an output to the bot.
  • Suggested answer
    PA-24021911-0 Profile Picture
    2 on at

    Hi!

     

    I tried to follow the steps you suggested, but for some reason my Copilot is not generating the .contentUrl. Please see the attached screenshot for reference.


    Do you know another way to make this work?

    Best regards,
    Gabriel Hiago de Sousa

    Screenshot_9.png
  • Suggested answer
    Beyond The Platforms Profile Picture
    171 on at
    Hi Gabriel,
     
    Thanks for the screenshot — this clarifies things. The empty `contentUrl` is a known behavior specific to the **Microsoft Teams channel**. When a file is uploaded through Teams, the attachment object Copilot Studio receives does not populate `contentUrl` in the standard way. Instead, Teams uses a secure, authenticated download URL that is stored in a different property.
     
    Here is what to try:
    Option 1 — Check `contentUrl` vs `content`**
    In Teams, the file reference is sometimes nested inside the `content` property of the attachment rather than `contentUrl`. In your Copilot Studio flow, try accessing:
    `First(System.Activity.Attachments).content`
    This may return a JSON object with a `downloadUrl` or `fileType` inside it. You can then parse that JSON string in Power Automate using a **Parse JSON** action to extract the actual download URL.
     
    Option 2 — Use the Teams file download URL directly**
    When a user uploads a file in Teams, it is automatically stored in their **OneDrive for Business** (under the Teams chat files folder). The attachment object contains enough metadata to locate it. In Power Automate, you can:
    1. Use the **Microsoft Teams - Get file** action or the **SharePoint - Get file content** action with the file path extracted from the attachment metadata.
    2. This avoids the need for an HTTP download entirely, since the file is already in the Microsoft 365 ecosystem.
     
    Option 3 — Add a debug step to inspect the full attachment object**
    Before anything else, I'd recommend adding a **Compose** action in Power Automate as the very first step, with this expression as input:
    `triggerBody()`
    Run the flow with a test file upload and inspect the raw output in the run history. This will show you the exact structure of what Copilot Studio is sending — including all attachment properties — so you can identify which field actually contains the file reference in your environment.
    Could you share what the Compose output looks like? That will let us point you to the exact field to use.
     
     
    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/


     

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 895

#2
Vish WR Profile Picture

Vish WR 337

#3
Haque Profile Picture

Haque 276

Last 30 days Overall leaderboard