web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Unable to pass variabl...
Copilot Studio
Unanswered

Unable to pass variable of type "File" to Power Automate

(3) ShareShare
ReportReport
Posted on by 25
I'd like to pass a variable of type File from Copilot Studio (CPS) to a Power Automate (PA) flow. While CPS does allow attachments, and these can be stored in a variable of type file, and PA does allow creation of an input of type "File" from CPS, their types don't match.
 
Process:
* When the user clicks on the paperclip icon in a CPS chat session then uploads a file, an event is fired and the system variable System.Activity.Attachments.Value holds the actual binary content of the uploaded file.
* When assigning this to a variable, the variable takes on the type of "File" and does contain the binary content. It looks like it's Base64 encoded.
 
* Next I created a PA flow from CPS to accept this File as an input. In the PA flow I selected an input variable with type "File" then in CPS I try to pass through my File variable.
 
This is the error I get:
As you can see, CPS thinks that PA is expecting an input of type "Record" not "File" as I had specified.
 
OK, so let's change that variable to the Record that contains the file attachment and see if that helps....
Good - It works in the CPS editor - the variable types now match, but I get this error at runtime:
 
 
So IMHO Power Automate should not allow you to specify an input type of File as it does not work from CPS.
 
I've tried converting the File variable in CPS to a string - using the JSON function (JSONformat.IncludeBinary does not work), and string functions like Mid (errors with BlobtoText is not implemented at run time) however these approaches don't work.
 
Next attempt will be to hand off the conversion by POSTing to an HTTP hosted helper function to convert to something else. However this in itself also seems to have similar type conversion issues.
 
Any ideas would be welcome.
 
THanks --doug
 
I have the same question (0)
  • Meekou Profile Picture
    200 Moderator on at
    As the error indicate, for now, you could only pass Text, Boolean and Numbers from Copilot Studio to automate.
    Based on my understand, it is impossible to pass file from Copilot Studio to Power Automate.
    Even we can accept file through http for power automate, we cannot pass file directly through Send an http request, and we also could not convert file to base64 in Copilot Studio
  • DougM_Barhead Profile Picture
    25 on at
    @Meekou I see the error. But, Copilot Studio has "file" as one of it's data types, and Power Automate has "File" as one of it's allowable inputs, as you can see from the screenshots. I guess this variable type and input type should not be offerede.
     
  • Veddd007 Profile Picture
    41 on at
    Hi, 
     
    Power automate does not accept File datatype from Copilot studio. You can use the following steps instead:
     
    • Use the "Create File" connector action to save the uploaded file in Sharepoint library
    • Retrieve the ID to access the file for further processes. 
    • For  summarization , you could use the Generative Answers node or AI Builder prompts in Power Automate by passing file context
    For reference:
     
    Hope it helps!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Copilot Studio

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 261 Super User 2025 Season 2

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 198 Super User 2025 Season 2

#3
S-Venkadesh Profile Picture

S-Venkadesh 93 Moderator

Last 30 days Overall leaderboard