cancel
Showing results for 
Search instead for 
Did you mean: 

Native base64 encode/decode

Would be great if PowerApps would support base64 encoding and decoding. Native would be ideal so this could drive offline. I would like to be able to communicate with an image OCR API.
Status: Completed

The canvas JSON function added last year will base64 encode images and media.  We don't have a way to convert other data types to binary, to then be base64 encoded; if there is more need here please tell us more about your scenarios.

Comments
New Member

Any solutions at moment?  API calls?

Anonymous
Not applicable

Please support this function!

New Member
To Encode:
 
TextForm = Binary.ToText(Text.ToBinary("Password"), BinaryEncoding.Base64)
Super User

@CarlosG Can you please share some more information?
Can I have the Base64 string of an image in Powerapps?
Right now we can use a custom connector and the image is sent to the database as a Base64 string. Is it possible to have the string in Powerapps before we sent it to the database?
I don't understand what you mean by
TextForm = Binary.ToText(Text.ToBinary("Password"), BinaryEncoding.Base64)
Thank you in advance 🙂

Regular Visitor

You can use Flow to handle Base64 conversions.

Basically the steps are to create a Flow that will accept a Data URI as a parameter, and convert it to Base64 like this:

base64(decodeDataUri(triggerBody()['convertpicture_Inputs']))

and in your Canvas app, call the Flow and pass the content as a url encoded parameter - here is an example of taking a photo from a collection and passing it into a Flow:

'PowerApp->Createanewrecord'.Run(First(photo).Url , BrowseGallery1.Selected.Case)

then you can return your base64 value this way:

https://docs.microsoft.com/en-us/business-applications-release-notes/april18/microsoft-flow/return-d...

 

I just wrote a blog on taking pictures using a Canvas app and storing the pictures in Dynamics CE (aka CRM) as Notes using Base64 encoding: https://eccosystem.blogspot.com/2018/11/capture-pictures-to-dynamics-customer.html

Power Apps
Status changed to: Completed

The canvas JSON function added last year will base64 encode images and media.  We don't have a way to convert other data types to binary, to then be base64 encoded; if there is more need here please tell us more about your scenarios.