cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Retrieving Data URI from an image added via the "Add picture" control

I am trying to submit a photo taken from a PowerApps app to a custom API. There are a number of tutorials written for it, but they all use the built-in camera control, which is very limiting as far as photo-taking goes. It seems that the recent addition of native camera functionality (https://powerapps.microsoft.com/en-us/blog/powerapps-v610/) should work much better, however I am struggling with obtaining the image data from the "Add picture" control.

 

The problem narrows down to the following: when you obtain image data from the Camera control (using the Camera1.Photo property) you get a long Data URI string containing the actual image, it like this:

 

data&colon;image/jpeg;base64<long base64 string follows>

 

When I obtain the image from the "Add picture" control (using AddMediaButton1.Media property) I get a string that looks like this:

 

blob:https://us.create.powerapps.com/dd6409a9-1b09-4ef5-a64b-21c84b16bb54 (if using the web player)
blob:http://127.0.0.1:49428/b7371d5a-bec9-45da-acb4-e2c6a1fefff6 (if using the Android player)

 

So it seems that instead of the actual image content I am getting some kind of a reference to a local blob storage, which is of no use for the purposes of passing it to the API that is expecting the actual image.

 

QUESTION: how can I obtain a proper Data URI string containing the actual image from the "Add picture" control?

27 REPLIES 27
Highlighted

Reading this thread makes me feel ill.

Is there any way for non developers to save images from powerapps to any kind of usuable (read useful) data source?

Isn't powerapps supposed to be marketed at non developers

Highlighted

Hey @seanbrogan

 

 

You could use a SharePoint library as a data source to save your pictures in it.

It is not as complex as others.

 


@seanbrogan wrote:

Isn't powerapps supposed to be marketed at non developers

Yes it is marketed that way, but when the business needs become to complex for just drag and drop there needs to be some coding done.

 

Kind regards

 

Tom



If this reply has answered your question or solved your issue, please mark this question as answered.

Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

Highlighted

Hi @Tom_Slosse

It's not possible to use a sharepoint library with the add picture control though is it? 

This thread details how it can be down using APIs, but honestly I wouldn't know where to start.

A number of threads point to what appears to be a popular method... https://www.youtube.com/watch?v=mp-8B1fLrqs
But I can't even get that working.

Highlighted

Hey @seanbrogan

 

 

It is possible to use a SharePoint library as data source to store pictures from your PowerApp.

I've done it for some barcode scanning app. You just need to make sure your SharePoint column is set to Picture instead of hyperlink.

 

There is a minimum of coding involved to get the picture into the SharePoint library, but it has been a while since I've done this scenario so I should refresh my memory on it.

 

Kind regards

 

 

Tom



If this reply has answered your question or solved your issue, please mark this question as answered.

Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

Highlighted

We first save the file to azure blob storage with the command AzureBlobStorage.CreateFile (you first need to add a connector azure blob storage).

 

Then we use a flow to read the created blob and save it to SharePoint, then we delete the blob.

 

No coding involved what so ever, but it's pitty to need to jump through so many loops for something that should be simple.

 

 

It's not a fast solution and it requires you to have an azure subscription which also costs money, but it does work.

 

Highlighted

Thanks @Peter1234 
I have a feeling thats going to be my only option, and I think thats where a lot of my frustration stems from.

70 odd microsoft business premium licences and its still not enough.

I wonder if this is a reason why no other solution has been implimented.

I need to walk away from this till tomorrow I think.

Highlighted

I feel your pain @seanbrogan 

 

If I understand correctly the Add Picture feature already stores the blob in some sort of internal storage area. So it's quite inefficient to do that twice.

 

If they would just somehow allow us to get that blob from the url that is returned by the Add Picture feature, we could just run that same flow and make it much more efficient...

Highlighted

Hello, how do I build the "Web API 2" function; in Visual Studio? 
Where do I put to get it in PowerApps availble?
Would you upload the Studio Project?
Thanks in foreward
Jens

Jens Rogge

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (10,453)