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.