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

Iphone Pictures to base64 / binary for saving them on sharepoint

Hey there power community!

I have problems converting iphone-pictures to base64.

 

The whole story:  we´ve made an app, that takes pictures (of damaged transports) and saves it to a sharepoint folder. we use a flow for that, where there is a "convert to binary image" function. 

all works perfectly when we use laptop camera or android phones! BUT: when i use iphone, the flow replies with following:

RichardWalter_0-1653031513726.png

Sorry, i cant provide that in english. It basically says, that the converting does not work. 

We use following code in powerapps:

 

 

ForAll(CollectionVariable; UploadPhotoToSharePoint.Run("EnterPictureNameHere".jpg"; Mid(JSON(ThisRecord.Url;JSONFormat.IncludeBinaryData);24;Len(JSON(ThisRecord.Url;JSONFormat.IncludeBinaryData))-24)));;

 

 


I tried to switch the iphone-config to "most compatible" settings for photos. that did not make any difference. 
Has anybody a hint for me, how i could get this work?

 

Thank you very much in advance!
Richard

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @RichardWalter ,

Two things - you have left out the Find on the comma (which is the important bit = please see the full code intention), but my advice would be to save the converted text in the collection (convert it when you save the photo) then send that text field to the flow. 

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

View solution in original post

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @RichardWalter ,

Please review this blog of mine - my users do 10s of thousands of pictures annually on iPads using this process. You will note that the JSON process I use does not assume the commas is at position 24.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

RichardWalter
Frequent Visitor

@WarrenBelz thank you for your reply!  

If my amateur-view on you suggestion gets this right: you mean i just need to change the numbers to 1 and -1 ?

ForAll(CollectionVariable; UploadPhotoToSharePoint.Run("EnterPictureNameHere".jpg"; Mid(JSON(ThisRecord.Url;JSONFormat.IncludeBinaryData);1;Len(JSON(ThisRecord.Url;JSONFormat.IncludeBinaryData))-1)));;

i tried this, that did not make any difference in the error message. 

maybe you would be so kind and describe your suggestion a little bit more?


thank you for your help!

Hi @RichardWalter ,

Two things - you have left out the Find on the comma (which is the important bit = please see the full code intention), but my advice would be to save the converted text in the collection (convert it when you save the photo) then send that text field to the flow. 

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

RichardWalter
Frequent Visitor

Hi @WarrenBelz !
We want to thank you for your reply. It opened our eyed to find the solution. It works with the following "finds":

ForAll(CollectionVariable; UploadPhotoToSharePoint.Run("EnterPictureNameHere" &".jpg"; Mid(JSON(ThisRecord.Url;JSONFormat.IncludeBinaryData);Find(",";JSON(ThisRecord.Url;JSONFormat.IncludeBinaryData))+1;Len(JSON(ThisRecord.Url;JSONFormat.IncludeBinaryData))-Find(",";JSON(ThisRecord.Url;JSONFormat.IncludeBinaryData))-1)));;

Thank you!

Richard

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (2,386)