cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

PowerApps: Upload an image to SharePoint using Flow

 

 I followed this Youtube video:

PowerApps Flow Intro Upload an image to SharePoint using Flow

 

It works great for picture taken with camera but when I tried to use "Add Picture" control from Media, Flow gives an error:
 
InvalidTemplate. Unable to process template language expressions in action 'Create_file' inputs at line '1' and column '1900': 'The template language function 'dataUriToBinary' expects its parameter to be formatted as a valid data URI. The provided value 'appres://blobmanager/9d22d3a1fa3e4ccbb534c4913f752b79/2' was not formatted correctly. Please see https://aka.ms/logicexpressions#dataUriToBinary for usage details.'.
 
Any suggestion.
1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: PowerApps: Upload an image to SharePoint using Flow

Hi @Anonymous,

 

I have made a test and the issue is confirmed on my side. 

 

The image the Camera control captured is actually a image Data Url, the standard format the image Data Url the Camera control captured as below:

data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAA
CNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwA
AAABJRU5ErkJggg==

So you need to convert the Data Url into a binary data within your flow using the dataUriToBinary() function, but the image the Add picture control captured is not a image Data Url, the image data format the Add picture control captured as below:

appres://blobmanager/0665075483e44d7ea1af450f3a61b472/1

So the dataUriToBinary() function executes failed.

 

If you want to upload the image captured via the Add picture control into SharePoint library folder, please check and see the following blog:

http://repointtechnologies.com/saving-images-from-powerapps-to-sharepoint/

 

In addition, please check and see if the following video would help in your scenario:

https://www.youtube.com/watch?v=mp-8B1fLrqs

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Community Support Team
Community Support Team

Re: PowerApps: Upload an image to SharePoint using Flow

Hi @Anonymous,

 

I have made a test and the issue is confirmed on my side. 

 

The image the Camera control captured is actually a image Data Url, the standard format the image Data Url the Camera control captured as below:

data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAA
CNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwA
AAABJRU5ErkJggg==

So you need to convert the Data Url into a binary data within your flow using the dataUriToBinary() function, but the image the Add picture control captured is not a image Data Url, the image data format the Add picture control captured as below:

appres://blobmanager/0665075483e44d7ea1af450f3a61b472/1

So the dataUriToBinary() function executes failed.

 

If you want to upload the image captured via the Add picture control into SharePoint library folder, please check and see the following blog:

http://repointtechnologies.com/saving-images-from-powerapps-to-sharepoint/

 

In addition, please check and see if the following video would help in your scenario:

https://www.youtube.com/watch?v=mp-8B1fLrqs

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Takuma
Level: Powered On

Re: PowerApps: Upload an image to SharePoint using Flow

Hi @yugpatel,

 

can take this workaround

 

 

Set Flow to accept the value from PowerApp for varbinary type of SQL database.

Please specify that value as SharePoint content

キャプチャ.PNGキャプチャ1.PNG

 

Best regards,

jgerardo
Level: Powered On

Re: PowerApps: Upload an image to SharePoint using Flow

@Takuma, Thank you for your response, the solution looks interesting. However, can you translate the language on your images to english for better understanding?

Highlighted
Takuma
Level: Powered On

Re: PowerApps: Upload an image to SharePoint using Flow

Hi @jgerardo 
Currently, the function JSON () can be used to send images to Microsoft Flow (Automate) as datauri.

Example)
UpdateContext (
{
Photouri :
JSON (Camera1.Photo, JSONFormat.IncludeBinaryData)
}
);

You can then save it in the same way as a camera image

Best regards,

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,636)