I am using the camera control to take a picture of a handwritten timesheet and automatically upload to a specific SharePoint folder. I have a power app working fine and it calls a Flow to handle the save. Here is how it works:
The user takes the picture and then taps an icon to save. The OnSelect for the icon is:
'UploadClientTimesheet-SavePhoto_1'.Run("ClientTimesheet-"&Text(Today(),"[$-en-US]mm_dd_yyyy")&".png", Substitute(Camera1.Photo,"data:image/png;base64,",""),Substitute(Camera1.Photo,"data:image/jpg;base64,","")); Notify("Your Timesheet has been submitted.", NotificationType.Success)
NOTE: The second substitute, Substitute(Camera1.Photo,"data:image/jpg;base64,",""), was my attempt to set it as png and jpg and try to have the Flow use the correct one.
When the Flow runs, it works fine for Android (which is saving the picture as png.) Apple iOS fails with, "'The template language function 'base64ToBinary' was invoked with a parameter that is not valid. The value cannot be decoded from base64 representation.'." After looking at the results, I found that an Android picture comes in fine with only the binary data but iOS sends:
"data:image/jpeg;base64, with the binary data after that, which I presume is because iOS is taking the picture as jpg.
I tried a condition asking if the FileContent starts with "data:image/jpeg;base64 to process as jpg but could not get it to match that correctly.
Anyone have any suggestions? Or, is there a way to do this directly in PowerApps without the Flow?