As the title says.. I'm building a power app that uploads an image to a sharepoint directory.
Following this blog I was able to successfully upload an image that was captured by a Camera Control.
However, I would like to do the same thing but with an 'Add Picture' Control.
My PowerApp function for doing this is
ClearCollect(PictureCollection2, AddMediaButton2.Media);
MediaToSharePoint.Run("test.png", First(PictureCollection2).Value)
I add the media to a collection, then Run a Flow with the value. This value is a form of a URL that contains the image stored as a blob. Here's an example of the value that gets passed to the Flow
blob:https://create.powerapps.com/79d7f767-4dff-448d-87ec-b3d2f7cdf27d
The flow has two steps; a PowerApp connector and a Share Point Create File
The flow is failing on the second step with a 'Bad Request' error.
Has anyone been able to upload an image to Sharepoint via an 'Add Picture' control?
Any help would be appreciated, let me know if there are any more details I should provide.
The usual way of getting images into SharePoint from Power Apps is to use Flow to create an image file in a document library. You can set the Flow to update metadata of the file to link back to your SharePoint item and return the URL of the image to Power Apps as a parameter that you can patch to a SharePoint column.
Make A Flow To Upload Documents To A SharePoint Library We will need to create a Power Automate flow to do it instead. Open the Power Automate action from the top menu and select Create a new flow. Choose the Power Apps button template. Name the flow UploadFileToDocument library and click Save.
After you have built your flow and collected the data you need, add the Respond to PowerApps action. In this action, define the output fields you want to provide to PowerApps. Name each field, and select Add Dynamic Content to pass in data from the actions in the flow.
We were able to solve the problem by saving pictures to a SharePoint List.
Here are useful links explaining the solution.
It's working!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With