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 / Power Apps / file upload functional...
Power Apps
Unanswered

file upload functionality towards a sharepoint document library

(0) ShareShare
ReportReport
Posted on by 401

I’ve made an app to test file upload functionality towards a sharepoint document library, using a flow to create the file on sharepoint.

 

It went smooth and worked as expected, I tested two components to select the files, being an ‘attachments’ control, and a MediaButton control (it’s call ‘add picture’ in the GUI).  

 

pic1.pngpic2.png

 

Both buttons call the same flow called SendFileToFlow using the code below which stores the file on sharepoint.

 

 

Set(FilePath2, SendFiletoFlow.Run( 
 { file:
 { name: Last(Upload1.Attachments).Name
 , contentBytes:Last(Upload1.Attachments).Value 
 } } 
));

Set(FilePath1, SendFiletoFlow.Run( 
 {file: 
 { name:Upload.FileName
 , contentBytes:Upload.Media 
 }} 
));

 

 

pic3.png

 

I had a nasty surprise when I tried the same code in the production app. It doesn’t work.

 

Now whenever I copy this working code into a new app, in conjunction with the very same flow, I get this exactly the same error message for each control:

 

pic4.png

 

 

So now I’m trying to understand why code is right in one app and wrong in the other.

 

I would assume since the contentBytes ‘type’ in the upload is set by the control it must be the same in every app!

 

How can I troubleshoot this further?

 

Thanks for any response.

 

While browsing the forums I found someone suggesting to add an odata type to the statement.

 

pic5.png

It doesn't seem to help, but maybe I did not get it correctly.

 

Michel

 

 

In both the working and the failing case the control.Attachments.Name and the control.Attachments.Value of the attachments return this:

 

secretstuff.pdf 
appres://blobmanager/1c18e61fbcf34bc4a9dd9bfed5706806/1

 

Categories:
I have the same question (0)
  • v-xida-msft Profile Picture
    on at

    Hi @MichelH ,

    How many parameters specified within your flow? Two or single one?

     

    Based on the error message that you mentioned, it seems to tell that you have missed a 'contentBytes' column within your SendFiletoFlow.Run(...) formula.

    Please consider consider re-create a new conection to your flow from your app, then try your formula again, check if the issue is solved. Also please check if you have made some changes to your flow.

     

    I have made a test on my side, and don't have the issue that you mentioned. Please consider re-configure your flow based on the following video resource:

    https://www.youtube.com/watch?v=kQVYid1p_vA

    https://www.youtube.com/watch?v=UYK7yruBHDM

     

    I have made a test on my side, the flow's configuration as below:

    1.JPG

    The sample of my canvas app as below (see the attached .msapp file):

    2.JPG

     

    Please consider take a try with above sample app I provided, then check if the issue is solved.

     

    Best regards,

  • MichelH Profile Picture
    401 on at

    Thank you @v-xida-msft ,

     

    You can see the column contentBytes in the run statement, so powerapps is only unhappy about the datatype of the column, not being blob.

     

    As said, if in one app this column type is fine, then I would expect it to be fine in another app, (using the same controls,) as well.

     

    Can you explain or advise how to troubleshoot this? 

    Thanks,

     

    Michel

  • v-xida-msft Profile Picture
    on at

    Hi @MichelH ,

    Currently, I afriad that there is no direct way to troubleshot this issue. Please consider copy your flow, and then rename it as another name, then create a connection from your another app to this copied flow, then check if the issue is solved.

     

    Have you taken a try to remove the flow connection in your app, and re-create a new one? If you export/import your original canvas app, the flow connection within this exported app would be invalid. Please consider remove the flow connection in your another app, then re-create a new one within your another app, check if the issue is fixed.

     

    If the issue still exists, please consider take a try with the solution (sample app) I provided, check if the issue is solved.

     

    Best regards,

  • MichelH Profile Picture
    401 on at

    Hi @v-xida-msft  Kris Dai,

     

    I've exported and imported the powerapp package to another name. That 'just' works.

    I noticed that, if I do a save-as of the flow SendFiletoFlow to SendFiletoFlow2 and try to connect the app to the other flow I already get the same error.

    I know '100%' the app and the flow are the same, ..... or at least the part I can see. This tells me the issue is in the part under the hood. 

     

    I think I will try to adapt Paul Culmsee's app and flow for my purposes and see how it goes.

    Michel

  • MichelH Profile Picture
    401 on at

    Using the video of Paul Culmsee, as provided by @v-xida-msft  Kris Dai, I was able to build a working upload.

     

    Michel

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 > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard