PowerApps upload file to SharePoint document library
HTML-код
- Опубликовано: 30 июл 2024
- Dec 2023 - I uploaded a new version of this video using the v2 trigger. Supports single or multiple uploads.
• Power Apps Upload File...
In this video, you will learn how to upload a file directly to a SharePoint Document Library. No crazy complex code, finally a straightforward way to save all files into SharePoint without a bunch of shenanigans.
Link to attachment control video • PowerApps Attachment C...
Link to string manipulation video • PowerApps Tutorial - P...
Link to Ramerio on Twitter / ohthreesixfive
Link to PowerApps training and curated library where you can download from training.PowerApps911.com Наука
Shane nice video but on the create file , the file name and content on dynamic content are empty how can assist on that
The way you upload has changed due to changes in flow.
Power Apps Upload File v2 to SharePoint Document Library
ruclips.net/video/cjcDH7_v6cE/видео.html
Thank you Shane then how do I display that uploaded file to gallery
@@ntethelelobuthelezi8925 ruclips.net/video/u-b8w9ea1kk/видео.html
Shane can you show me something like upload a file using attachment component and display that file in a gallery it doesnt have to go to sharepoint
Shane I love your work man, you've saved me countless hours trying to figure out all of this stuff. These videos are a life saver. Cheers mate!
Glad to help. 😀
A great teacher with great content..I struggled a bit after creating the Instant flow..sharing one learning/observation to save others that time and effort..when following the video make sure the variables ( the one we are picking as "Ask in PowerApps" - do not repeat that step as it creates duplicate variable/memory and equivalent number of arguments would be asked in powerapps then resulting the flow to be failed. I had to create new one to overcome that..Cheers..
Hi Shane. I just want to let you know that this video reached a guy many miles away and helped him and his team to reach impressive objectives. I was looking for this for so long that I almost gave up. Cheers from Brazil.
That is awesome 🐶
Thanks Shane. This is the second time I have watched this. The first time I got all turned around and couldn't get it to work. Just went through it again and it works like a dream. This is exactly what I need for a file uploading app. Thank you for all your great videos.
Great to hear!
I will tell you what, I wanted to save time to achieve this functionality, First thought: Shane video: too long.. nah!! watched whole lot of other videos in RUclips. Try to implement in easy way, spent a whole day. And then I realized, Shane is the community expert lets go back and watch his video. 40 mins to implement. Boom!! Working now. I should have done this first. Kudos to you Shane. !! Man of the year !! No other words to say
Thanks. Sometimes videos are long but they are always long because that is how long it takes to teach the topic. Never because I ramble. :)
@14:46 made me lol. Shane, thanks again... Learning lots man. Watched this one about 3 times in it's entirety in sections over 2 days. Rebuilt the whole thing to learn along w/you. Going to watch the next one so I can send metadata (columns in SP) along with the file.
I don't fully get why we need to keep the image control however if the file is not an image and we don't need to visually validate it. I guess I will watch again haha. Nice work brother!
This is super cool Shane! Thanks for sharing! Would really like to see how you return files into a Gallery Control from a document library... Great job!
I like this idea also.
Shane Young Have been a huge fan since the days you and Todd did your talks at The SharePoint conferences way back. I was wondering if you have work out how to return files into a Gallery Control from a document library? Would love to see a video on how! Keep up the great work!
Fantastic video Shane, as always. For some reason, it took me two tries through it to get it to work. But I am proud to say that I was able to integrate it with another "append comments" video of yours. My project required that the gallery item's edit form have the ability to add text AND screenshots / images. So I consolidated this solution into the append comments and changed the code of my Save button. I added an If statement of "If(varFileLink = Blank()" then added the code for appending text if true and appending a link to the image file if false. It worked like a charm!! Thanks again for all your great content. I use your curated library a ton as well. 🙂
Good job Tena. And thanks for sharing what you did. It helps others. :)
Shane, this was exactly what I needed and explained it perfectly. You are a Legend!
Thank you, Shane! This is again a great video with impressive content.
Thank you
Thank you so much Shane! Finally... I can use attachments!!!
Glad it helped Barry
We've been using a SPO List to attach a file and then move it to a DocLib with meta data. This will reduce overhead and should increase reliability by making the upload direct (Thank you x M). General Note: If I was a hardcore Apple guy [dry-heave] and refused to do anything Microsoft, I would still watch your videos for the entertainment value alone. You, my friend, are the Gene Simmons of Power Apps!! Thank you for what you are doing!
Rob you are too kind. Happy holidays to you and your wonderful family if I don’t talk to you soon. 😍
Congrats, Shane, on cracking this nut after 1-1/2 years. This is a critical business need. Looking forward to putting it in use.
Thanks Jim.
Shane!!! second time you save my neck, again, love you man!
That is awesome Jean!
Good Job !, implemented in my new project and working like a champ ! thank you
Glad to help. 😀
Shane, its 2021 and you still the man! (Its over a year and your stuff is still relevant!)
Thanks 😊 Wait till you find the 4 year old videos that still work also. Love the long shelf life.
Another excellent video! Thank you for sharing! I started learning PowerApps just a few weeks ago but can create apps for work now, using your videos. You save me so much work. Thanks again.
Awesome 😎
Thank you so much for this. I have followed your entire process step by step and am getting an error with the Set(VarFileLink... part.
Although my code matches your exactly, I'm getting an invalid number of arguments: received 2, expected 1.
Do you have any quick thoughts on why this might be happening?
Thanks again
I am having the same issue did you find a solution?
I'm getting this same error. Did you ever find a solution?
I found the solution...When you're doing the section in the Flow for "File Content", make sure you're using Createfile_FileContent instead of Createfile_FileName.
@@andielandino5957 Thank you!!!! I've been trying to fix this issue for a bit too long now.
Hi Shane. Love your videos brother. Love your passion. Keep sharing the love.
Some viewers might have last update of PA where 'Run' needs 3 arguments, hence the lines would look like this :
Set(VarLast, Last(AttachmentControl.Attachments).Name);
Set(VarFileLink, UploadAttachmentCD_Award.Run(VarLast, VarBase64Only, VarBase64Only).sharepointfilelink)
Let me know what you think or if you have a prettier solution?
Peace
Thanks for sharing. 😍
could this explain why suddenly my upload file function isn't working anymore ? I've used this method for a few months now and all of a sudden my flows ''succeed'' but my pdf files are corrupt on sharepoint.
Excellent video, keep up the good work for the power platform community. Wouldn't have built out our LOB app without your videos and mentoring.
Thanks Mark. You ain’t bad at Power Apps yourself. 😻
Such a helpful video!! I was stuck on trying to upload a file to a REST API for so long and finally succeeded in doing so using this video! Thank you so much!
That is awesome Sarah. Good job. 🙌
NEW! Dec 2023 version of this video for single or multiple uploads.
ruclips.net/video/cjcDH7_v6cE/видео.html
Be sure to checkout the curated content library and subscribe to download this app and formulas and a whole lot more. training.powerapps911.com
Check out multi-file upload including drag and drop now available here: ruclips.net/video/7UeRzfPo8RE/видео.html
Hi Shane, Thanks for all the useful videos. Can you please help me in getting little help for my requirement. I need to upload an excel file from user's local machine to one drive from power apps. I know this can be done through cloud flow, but can you please help me for the flow steps. And after uploading the excel file, i want to read the content of excel and return it back to the power apps. can you please give some pointers here.
I know Im asking the wrong place but does someone know of a tool to log back into an instagram account??
I was stupid forgot the login password. I would love any tricks you can give me!
Most of the Power App solutions I'm wanting to build require uploads to a SharePoint document library, so this tutorial is the missing link I've been searching for. I am ecstatic!! 🥳 Thanks Shane
Hey Wendy, there is a newer version of this video, they changed some stuff ruclips.net/video/cjcDH7_v6cE/видео.html
Thank you for the link, Shane. I'll give it a watch
Great Job, Shane!! I've been looking for this for so long. Thank you so much!
Happy to help!
Thanks so much Shane. You saved my mind. Been trying to do this for a super long time. You are my goto guy from now on.
Glad to help. 😀
Hi Shane... First, I would like to thank you because your videos have been my primary source of learning, regarding PowerApps, over the past year or so...
Second, I'd like to offer up my own twist on this amazing way to upload files.
You actually can upload multiple files at a time. You just have to tell the attachment control to "Collect" the name and value each time a file is added, or remove the file from the collection whenever a file is removed from the attachment control.
When you are ready to do the uploading, you need to use a timer... I use a duration of 10 seconds because I've noticed it takes about 4 seconds for the flow to add the attachment to the document library... It really doesn't matter how long the timer duration is, though, because you can set a flag for the arrival of the thumbnail that Flow returns to PowerApps after it finishes adding the file to your doc library.... If the file hasn't been returned at the timer end, you take no action... .If it has, you add the thumbnail to a verification collection, remove the first item from the collection you created when you added files to the attachment control, and re-run the flow call from PowerApps over and over again until CountRows of the collection is zero..... I was super excited when I figured this out....
Again, thanks for your dedication and commitment to teaching. What you are doing is extremely valuable because when a business needs to solution to a particular problem and can't wait 5 years or budget $15MM for an enterprise solutions, the PowerApps/Flow/SharePoint standard tools offer mere mortals a way of solving extremely urgent business problems....
Awesome. Thanks for sharing 😀
As someone just starting out in a new role which involves a lot of PowerApps this was a fantastic help. Thanks for the great videos.
Very welcome!
Absolutely fantastic - easy to follow and extremely well explained! Thank you so much Shane! :)
You're very welcome!
Love to hear “After a year and a half” making it easy for us. Thank you!
Making this video was hard but worth the effort. 🤩
Ohh Shane! That's so marvelous! I had re-viewed this vid a few times but got it to work with the PDF - Function to generate a PDF File in the PDF viewer (I think you made a video about that), and passing this through the image control gave me the 7:33 reaction! Woohoo! No more complex calculations within PDF forms but simple calculations in the app! Much easier to maintain! And our business people hate filling out PDF forms!
Now while patch adds data directly into Sharepoint, just for the PDF file I still need a flow. If there were a way to Patch this data without a flow into sharepoint ... there is this Forms attachment.update thingy ... I need to investigate ...
Thank you so much for the many inspiring videos :)
Awesome Mike! Glad to help. 😀
You, sir, just saved the PowerApps team from my anger at the SharePoint conference in Prague in December this year ;)
Why is this not a standard feature after 2 years of PowerApps?
I was also looking for a solution to this last year..... Many thanks to you and the Twitter user you mentioned.
This is very rare here on RUclips that 99% of your videos really help people meet their customers' business needs. I am so grateful for your channel, it helps me so much in my daily work. :)
Glad it helps. Enjoy Prague 😻
This is amazing. Will be definitely be using this! You never disappoint, great video.
Awesome! Thank you!
Many Thanks Shane, Learning is so much fun with your videos!
My pleasure!
Love this! Got it working exactly the way I need. Now onto the next step, Multi-File upload implementing these principles.
Fantastic!
I know this is a slightly older video but it helped out a lot! Around the 25:50 mark, you mentioned having to click the attachment control multiple times sometimes, this is likely because only the "Attach file" part of that control is clickable.
You nailed it Jon. 😎 I got better at this one over time. Thanks
Hero of the day and yes, bless you :) (what a sneeze...) This topic is very popular on internet but you first explain in detail whats going on... Great Job and thanks.
Glad to help. 😀
Shane, you're an absolute legend mate!!! Worked like a charm. The amount of people you keep in their jobs 🤣🤣🤣🤣
Glad to help. The more people building the better for all of us.
Love you work Shane, you're so passionate with it. A great guru.
Thanks! 🤩
Shane my man got every tutorial for PowerApps i need.
Glad to help!
Fantastic. Exactly what we needed to get us going. One issue I initially have is when adding multiple files (form file explorer, ctrl or Shift click), PNG files do not get uploaded, they need to be uploaded manually.
Next step is to add the ability tag with metadata for uploads, then have a combo of power apps/Automate fill the metadata. Probably need to add an item or file update step after adding the file in the Power automate.
Here is a video on Multi-upload ruclips.net/video/7UeRzfPo8RE/видео.html
Here is a video on Setting Metadata ruclips.net/video/e0kMjb686tc/видео.html
Excellent and well explained, thank you so much for making simplifying our work !!
Glad to help. 😀
Love you reaction when getting base64 info.
Thank you for all this great videos!
Very helpful! Thanks Shane and like all the dog images in your videos
Man, you keep saving my day over and over again. Thank you.
Great piece of work, exactly what I was looking for. Thanks for sharing.
Happy to help
Hi Shane, can this also work when uploading Microphone.audio content from a PowerApp? We're currently struggling because we have successfully uploaded audio that is captured from an app on a desktop, but when recording audio on a mobile device (Android and iOS) it errors out because of the different method they appear to store the content on the devices. Thanks :-)
7:32 MIND=BLOWN .. You are amazing Shane! Thanks for your videos. I used this trick to upload files into a Gis Cloud storage.
Awesome
This helped me a lot! Thanks, your videos are the best as always.
Happy to help!
@shane
Getting below error, Could you help me to fix it?
Unable to process template language expressions in action 'Create_file' inputs at line '1' and column '8693': 'The template function 'base64ToBinarytriggerBody' is not defined or not valid.'.
Hi Shane, You make everything in Power Apps simpler. Lots of love from India 🇮🇳 for Chewy 👍🏻
🐶 Chewy says thank you. 🐶
Fantastic. I will for sure use this in a customer project where they have 8 different SP libraries and I can create an app that "magically" finds the correct one (based on AD properties) and uploads it (with a bunch of column values as well)
Nice!
Thank you so much Shane for this amazing video. I just have an issue that I can't resolve. When I am trying to I click on "Button" after applying the varDemoAttachmentControl as you explained at 7:08, the "Label" box is empty and I can't see anything inside. What am I missing here?
So how does this work with power apps v2 trigger? Do we select text or file content for the base64 information?
I tried using the default trigger and when I am working on rest of the flow it starts creating new input requests x10+. Happened twice and I've lost so much time to this :( thanks
Shane Thanks!!! but the thing is that with this method ALL the field have to be filled in, is it possible to use optional fields?
Shane, thanks a lot, but I have a problem. When i set the variable setVarFileLink, I copied your formula exactly the same, but didn’t work. One part of the formula says Invalid number of arguments, received 2, expected 1. I don’t have the smallest clue of what argument am i missing, and I swear the formula is letter by letter identical to yours. Appreciate if you can help thanks
Hi Shane. I've used your tutorial and it works great! Question - if someone adds an attachment to the control, it goes straight to the document library. But if they attached in error and click the cross to remove it from the control, how do I delete the file from the doc library please? Thank you!
Thank you thank you thank you. You have no idea how grateful I am for this.
Glad to help. 😀
Hi Shane,
I tried to attach more than 1 attachments (files) but only the last one uploads into the library. I have set the settings max attachments to quantity 5 and 9MB but still.....
Saved me, hours of time in fixing file upload issue using powerapps v2 connector. Thanks!
Glad it helped
Really nice technical video which clear idea of power app with file upload with out of the box control. thanks Shane
Glad to help. 😀
I am using this method, but the base64 is way way too short. However, it starts with this: "data:image/svg+xml;base64,PD94bWwgdm... It seems right. But, seems corrupted in Sharepoint. Any ideas?. It looks proper in flow too. Pre/postfix is removed, but it seems way to short to contain anything close to what is in the actual pdf file.
Awesome work! I think you down played the finishing touches a bit as they were some fabulous tips. 👏
Thanks Sam. I was just so excited at the big idea I couldn't even evaluate the little pieces. 🥰
Is it possible to have multiple attachment controls in one form?
I created tabbed form and 1st tab I have 1 attachment control and in 2nd tab have 2 attachment control,. Is it possible?
YOUUU ARE THE BEEEST!!! HUG FROM BRAZIL!!
There is a newer version. 😎 Power Apps Upload File v2 to SharePoint Document Library
ruclips.net/video/cjcDH7_v6cE/видео.html
Hey Shane, this is great! Thank you very much for this video.
Glad it was helpful!
Is there any way to connect this function with forms? Like Uploading a file from PowerApps into SP-Library + giving that specific file column values through PowerApps (e.g. with DropDown-Menus or Checkboxes etc.). I searched now for more than a week and as Newbie, I couldn´t find any solution to this.
Great video as always. Thanks for that.
With the PowerApp connector V2, you can now save yourself some effort and also have the advantage of being able to upload several files in one go.
I use the attachment control from a form as described by Shane, but no longer have to limit it to one file. Then I use a "ForAll" over all its attachments and pass the data of each file in turn to a flow.
In the flow, I use the data type "File". This then expects a record with "name" and "contentBytes" from the PowerApp. I fill "name" with "Name" from the attachment control and "contentBytes" with the "Value" of the attachment control. Nothing has to be converted for the value, no matter whether JPG, GIF, PDF, DOCX, XLSX or anything else is passed, the flow takes everything and makes the correct file in SharePoint out of it. Because I did not succeed in using "name" from the record as the name for "Create File in SharePoint", I also pass a string with the file name to the flow, again "name" from the attachment control.
Awesome Andreas! I think in 2023, at some point, I will remake this video showing the v2 way. 🥳
When I'm creating this in Teams Powerapps I'm Struggling with a error code 502 "the server did not receive a response from an upstream server". I've tried creating the flow within the teams powerautomate app rather than directly in power apps and it works. But for some reason it won't within teams powerapps. Any help would be massively appreciated.
Shane, You are the best man. You just solve my issue! Thank you
Glad to help.
This is great. Thanks for sharing Shane!
You are welcome Peter
That was impressive! Thank you for sharing your knowledge and for giving credit where it's due.
Glad it was helpful!
Hi Shane. Awesome video! I've got this working and saving files to a SP doc library (instead of to the SP list I originally had). One question though - the attachments do relate to individual records on my SP list. Is it possible to navigate to a record in my App (from gallery to form) and see the attachments and be able to open them?
I also have the same case, do you managed to find the solution? 🙂
Hi Shane ! Thanks for sharing, very helpful.
Do you know how to test if a folder already exists ?
i searched but didn't found an easy way to check it.
thanks
I got all of this working in test mode for our use case! Would love to know if you have any tips or additional videos on being able to display a confirmation pop-up or message to the user once the file is uploaded?
Shane, Thank you for the excellent video. Do you know there is a way we can set up an email notification or any confirmation message to the user after the file has been successfully uploaded to the SharePoint library?
Sure. Add the logic to your button OnSelect after the flow is done. Or add the notification action to the flow itself. Check out this video where I return the link to the SharePoint file from flow ruclips.net/video/ovLIwnj6QjU/видео.html
Unable to process template language expressions in action 'Create_file' inputs at line '1' and column '9871': 'The template language function 'base64ToBinary' was invoked with a parameter that is not valid. The value cannot be decoded from base64 representation.'.
Hi Shane, really cool video! I've been looking for this for a while. When I get to 8:21 on the video, and map the button to Image1.Image my PowerApp freezes and crashes. I have no idea why this is the case. Is it because of the file?
Thanks
PROBLEM! I am using this method to upload pictures into a sharepoint document library and it works but when taking a photo on mobile device to upload the resolution is reduced quite alot. the picture is 2 or 3 MB but when in sharepoint is only KB's and its visibly lower quality than the device produces. :( it was going so well. Any ideas?
Hi Shane, super helpful video! If I wanted to go beyond this concept and read the excel file that was added to the document library and append those rows to a SharePoint list - what would be the best way to do that? I've been trying to work this out but am a bit stuck.
This video has those steps. 😎 ruclips.net/video/QcWjAt7QVn4/видео.html
Hi..I have a question here... can we save the powerapp New form as a file in SharePoint? Like we save InfoPath form as file..
this video is a life saver, thanks Shane!
Glad to help. 😀
Thanks Shane! Awesome tool to add to our toolbox.
Thank you 🙏
Sir Shane!,
This is what I needed so long ago, I searched and searched and it was so "simple."
Now, we need the PDF preview to be incorporated into the gallery to close the cycle.
Really thanks!!!!
I usually just Launch the pdf url.
Hey Shane, thank you for this incredible video. I'm facing an issue when I try to convert the file to binary. When I run the button with the expression Set(AttachmentControl, JSON(Image1.Image, JSONFormat.IncludeBinaryData)) my browser get stuck and I receive not responding messages and take too long to generate the JSON expression. Do you have any idea why this is happening. Greetings from Brazil
Shane, you are the man for this one!
Thank you! It took a long time to work it all out.
Shane, thank you for your work ... is a cristal clear speach ... Thanks a lot !
Happy to help 🐶
Awesome video, Shane. that was really helpful. Many thanks to you!!!
I am facing a certain issue though. The upload works great sofar, however, the files (images) have no format (".png" is missing in the name) and can only be opened in paint. On clicking on the file in sharepoint, a new tab is openend in which a download automatically starts. The downloaded file can then be openend in paint. Any ideas as to what i might be missing?
For now, i simply concatenated the image's name in the Flow.Run() call with a ".png" (I'm only uploading images anyway). But obviously that isnt an optimal solution...
Hi, Shane, thanks a lot for your great video ! I would like to know if possible to upload a file(excel) and to compare it with a sharepoint list . Is that possible to get content from JSON or should put the uploaded file somewhere and compare it? thanks for any advise !
This should give you some ideas ruclips.net/video/QcWjAt7QVn4/видео.html
Hi Shane,
Thanks for all you vids they help alot.
I can upload all the documents in PdF but how can i one i have done all checks and balances add them as attachments from my document library to an email. They are all lined using a customer number so i can view them no problem from my app, but i cant seem to add them to an email to send it, most of it is 15 attachments or more
I know I'm late to the party, but THANK YOU! This was exactly what I needed. Liked and Subscribed!
Thanks for the sub! Happy New Year!
Hi Shane, I have a Canvas app where when you create a new item in a list, there is a Power Automate workflow that creates a folder in a document library which is named the same as the list item title. This is so that associated documents can be stored in that folder. When I open the form, I have a link to the document library folder for that item where I can click on, get taken to the folder and upload documents into it.
Is it possible to configure the workflow in your video to upload the files into the folder associated with the list item for the PowerApps form? rather than into just one folder in the document library?
On another note, do you know why PowerApps doesnt refresh a gallery when opening a form? I have to refresh the page in SharePoint 5-6 times when opening different list items to see the gallery/document folder that is associated with that item as otherwise it keeps on displaying the last viewed item.
Thanks,
Chris
Chris you can use Ask in PowerApps in your flow to prompt for the folder. Have your app look up the folder and send it to the flow. 😀
Great PowerApps tutorial as always!
Thank you.
Thanks a lot!! Great Video! a quick question- Can I rename the file before saving it to sharepoint? lets say with a text input? or a label?
Yup. Change the filename portion to use a TextInput
Hi Shane. Thanks so much for this video. Would this work in your repeating table solution as well? Your repeating table solution has been successfully implemented but we're having some issues with how the attachments are organized so we're thinking of moving the files out of the list and onto a document library and linking that document library back to the details list through an ID. Any response would be appreciated.
Yes, absolutely taht sounds like a good way to go.
You saved me so much time on this! Thanks!
Glad to help. 😀
just awesome! thank you! I tried it out not using attachments, but Add Media With Image (and into a collection) and also into 2 separate buttons... it worked perfectly!!!... I am building an offline app and need to upload several photos from inventory reviews... now i need to figure out how to give the file a name related to the location scouted and how mass upload the base64 :P... kinda feel smarter tonight thanks to you!
Nice work!
@Shane Young - I see this doesn't open the excel where it is uploaded. It errors out opening it says~ " Couldn't open the workbook because the file format may not be matching with the file extension"
I have never seen that error. I demo using an Excel file all of the time so I am sure this works for Excel. Maybe give it another go?
Fantastic Shane, as usual, I dare say I will be using this at some point. Next guide "How to upload attachment to SharePoint List" :p
I will see what I can do
Wow !! Thank you !
and Double "Bless you" - the 1st for the sneeze and the 2nd for this video. 😜
Thanks Rachel