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 / Agent flow File input ...
Copilot Studio
Answered

Agent flow File input mapping error: “Input variable UploadFile is of incorrect type: File”

(0) ShareShare
ReportReport
Posted on by 7

I’m working in Copilot Studio and have created an agent with a topic that calls a Power Automate Agent Flow. My flow contains three input parameters:

  • two String inputs, and

  • one File input.

In the topic, I also added three corresponding output parameters of the same types.

However, when I try to map the topic variables to the flow inputs, I receive this error: “Input variable UploadFile is of incorrect type: File.”

  To work around this, I attempted to manually map the File input using a formula:

{
  contentBytes:
   First(System.Activity.Attachments).Value,
  name:
   First(System.Activity.Attachments).Name
}
  But when I test the agent, the flow fails to start and I get this runtime error:

Error Message: The flow 'SOC1 Vendor File Upload Flow' ('a57a9afc-df1e-f111-8341-6045bd0693d5') failed to run with response code 'BadRequest', error code: TriggerInputSchemaMismatch. Error Code: FlowActionBadRequest Conversation Id: 5bdf19fa-e48d-4ba0-89e0-3fa6b8804577 Time (UTC): 2026-03-14T17:05:01.720Z
VendorFlow.png
AgentFlow.png
AgentFomulaMapping.PNG
I have the same question (0)
  • Nivedipa-MSFT Profile Picture
    Microsoft Employee on at
    Hello ,

    This happens because Copilot Studio cannot pass a File variable directly to a Power Automate flow. It treats the file as a record, not a true File type.

    • The TriggerInputSchemaMismatch error occurs when the file record shape doesn’t match what the flow trigger expects.
    • The fix is to pass the file as a record with file name and file content, not as a File variable.
    • Make sure the file content comes from the actual file content field (not a reference or value wrapper).
    • After fixing the mapping, always refresh the action node, republish the agent, and start a new test conversation.
    • In the flow, ensure the “Create file” action uses the incoming file name and content correctly (convert to binary only if required by the connector).       
  • Verified answer
    AM-14031710-0 Profile Picture
    7 on at
    The issue was caused by the File → Identify → “Include file metadata” option not being enabled in the Copilot Studio topic.

    Once I selected “Include file metadata”, the File parameter mapped correctly and the flow started working as expected.
    IssueResolve.PNG
  • Suggested answer
    rzaneti Profile Picture
    4,476 Super User 2026 Season 1 on at
     
    Another possibility is to pass the System.Activity.Attachments as a value inside a JSON object and handle the logic to access the File name/content in Agent Flow/Power Automate, since a Record data type in Copilot Studio is simply a JSON. For example, you can use a formula like this:
     
     
    As already mentioned, you need to convert the content inside the flow and set up the Run-only settings, if you want to use the maker's credentials to execute the SharePoint action.
     
    You can check the implementation of a solution for this exact same use case (saving attachments from Copilot Studio to SharePoint) in this video: https://youtu.be/VPVkFyGiBmY or in this blog: https://digitalmill.net/2025/05/20/send-files-attached-by-the-user-from-microsoft-copilot-studio-to-power-automate/
     
     
    Let me know if it works for you or if you need any additional help!
     
    If this solved your issue, please mark it as Accepted Answer.
    👍 If it helped, feel free to give it a like!

    🌐 Explore more Power Platform content on my Website or on my ▶️ YouTube
    💼 Find me on LinkedIn

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 259

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 195 Super User 2026 Season 1

#3
Vish WR Profile Picture

Vish WR 180

Last 30 days Overall leaderboard