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 Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,579)