Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Copilot Studio - Calling Actions from Copilot S...
Unanswered

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

Like (3) ShareShare
ReportReport
Posted on 13 Feb 2025 03:40:08 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
 
Categories:
  • Veddd007 Profile Picture
    14 on 25 Feb 2025 at 06:06:53
    Unable to pass variable of type "File" to Power Automate
    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!
  • DougM_Barhead Profile Picture
    25 on 20 Feb 2025 at 23:54:27
    Unable to pass variable of type "File" to Power Automate
    @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.
     
  • Meekou Profile Picture
    189 Super User 2025 Season 1 on 13 Feb 2025 at 08:47:57
    Unable to pass variable of type "File" to Power Automate
    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

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,518 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,744 Most Valuable Professional

Leaderboard

Featured topics