Skip to main content
Community site session details

Community site session details

Session Id :
Copilot Studio - Calling Actions from Copilot S...
Suggested answer

File Attachment Type Mismatch Error After System.Activity.ChannelData Deprecation

(0) ShareShare
ReportReport
Posted on by 4

My file uploads in Copilot Studio broke after recent updates. I upload files but get a type error when passing them to my Power Automate flows. Error: "Input variable 'InputFile' is of incorrect type: Record(Content:File,ContentType:String,Name:String,Value:File)"

 

Context: The old method `System.Activity.ChannelData` worked fine but was recently deprecated as what I've read. I'm trying out `First(System.Activity.Attachments)` (naned it as FileContent variable) and it returns a Record type but my Power Automate flow expects File type.

Still, the confusing part is that in Flows I set the InputFile parameter to 'File' type, but when I go back to my Copilot Studio agent, it shows up as 'Record' type instead. When I try to change FileContent to match this InputFile type, it doesn't work!!!

 

I need a way to pass uploaded files from (UI via MSTeams) Copilot Studio to Flows for further OCR processing. Can anyone help?

Categories:
  • CU18070145-0 Profile Picture
    4 on at
    File Attachment Type Mismatch Error After System.Activity.ChannelData Deprecation
    Hi @Michael E. Gernaey

    So here's how the agent works: 
    1. Firstly there is a Question Node and it identifies a 'File' attachment as an answer to that. 
    2. Then I set a variable FileContent == First(System.Activity.Attachments) to capture that attachment
    3. Then this FileContent gets passed to the Action node (to the powerautomate flow)

    The PowerAutomate's very first trigger is when an agent calls the flow and the input is of type file.... 
     
    Let me know if you need more information pleeeease 
  • Suggested answer
    Michael E. Gernaey Profile Picture
    45,089 Super User 2025 Season 2 on at
    File Attachment Type Mismatch Error After System.Activity.ChannelData Deprecation
     
    So technically File Type IS a record type because it looks like, which is actually a record. 
     
    file: {
        name:
        contentBytes
    }
     
    So FileContent is a record and the next line isn't because you have FileContent.Content or whatever it said I closed the picture.
     
    I do not know why yours is breaking but I will have to try it out and see if I can reproduce it.
     
    how is the file given to the Agent so I can reproduce the exact thing you have.
     
    Oh and something I just noticed (duh) I should have seen it.. is 
    The new format has the Type string in it, which the normal file type does not... hmmm..
    I am certain I can give you a fix, if you just share (per the below). but I can see why that record does not match the File record as there is an entire extra parameter. So we have to create another variable that only has the 2, then pass that. <== is what I plan to do.
     
    The more information you are willing to share (exact configuration) I will build it out and try it also.

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Copilot Studio

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 169 Super User 2025 Season 2

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 150

#3
sandeep_angara Profile Picture

sandeep_angara 75 Super User 2025 Season 2

Featured topics