Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uploading Image to SharePoint from PowerApps via Flow

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.

like image 444
Probably Avatar asked Nov 02 '17 21:11

Probably


People also ask

How do I upload photos from Power Apps to SharePoint?

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.

How do you upload files to SharePoint library with Power Automate?

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.

How do I transfer data from Power Apps to flow?

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.


1 Answers

We were able to solve the problem by saving pictures to a SharePoint List.

Here are useful links explaining the solution.

  • "Save Attachments to SharePoint List using PowerApps" (YouTube Video)
  • "Add attachments to SharePoint lists" (Blog Post)
  • "Showing List Attachments in a gallery" (Forum Thread)

It's working!

like image 112
Tolbxela Avatar answered Sep 19 '22 10:09

Tolbxela