Showing results for 
Search instead for 
Did you mean: 
Post Patron
Post Patron

Encode base64

Hello i have an application where i upload multiple images with powerapps and power automate to a server. The server requires base64 plane text ( just the base64 value ) how can this be done in power apps and power automate ? The images has also nametag, timestamp and are stored in a collection before shipped of to power automate for then to be posted to server. 


Cant change it to .image it has to be media else it throws "it expects Text-type and i use a error-type"

hm want the image to have imgtype: base64value, name: image_name, timestamp: DatetimeNow. 

thats teh values i want for each image, so i can loop trough it in the power automate and send each image off to server 

Hi @langsem ,


Got it. Does it work?

Set(JsonCol;JSON(colBase64;JSONFormat.IncludeBinaryData));; IMG_API.Run(SONR;reg;Jobbtype;FORSIKRING;JsonCol)



is it jsonCol i shall store to a label? to see the base64?

Hi @langsem ,


If you want to see the base64 code of the image in collection, use this:



JsonCol is a JSON script of the entire collection colBase64, not JSON for images.



hm something seems wrong. Because went i upload it to server i get a blank image.. and the url its very short to be base64


Hi @langsem .


Did you change to use UploadedImage1.Image if you worked with 'Add Picture' control?

If it still report that error-type error, try to change the collection name to create a brand new collection.


hmm now it just broke my entire app so nothing works . 


Ok lets me break it down for you. 


I have 5 add image controllers, where i upload a image from either camera or local library. I then after picking 1-5 images store them into a collection with value Imagetype: ( the base64 value its whats intended ), Name: image_name , Timestamp: Datetimenow. 

then when thats done i send the collection to power automate. 

Hi @langsem ,


OK, so what is DMG_SCHEME_BTN? Please share some snapshots.

Here is my steps:

First, use the following code to generate a image collection. here the Image field is binary type, we need to encode it to Base64.

Collect(imgCol;({Name:"Skademelding.jpeg"; Image:DMG_SCHEME_BTN.Media; timeStamp: Now()}))

Second, add a new column "Imagetype" to store the base64 format image, and delete the Image column.


 Third, convert the colBase64 to JSON script in order to pass the table to flow.

Set(JsonCol;JSON(colBase64;JSONFormat.IncludeBinaryData));; IMG_API.Run(SONR;reg;Jobbtype;FORSIKRING;JsonCol)


Which step went wrong? Please go to File - Collection to check the collection data.


Here u see. Green mark its the dmg_schem_btn ( its the add image conntroll ) and in the onselect prop i have the code shown in image 

then i have a btn that sends the information to flow ( marked with Red ) 

The orange marked one are the lbl to display the base64 i will delete that lbl later, its just for testing purpose now 





Helpful resources

2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,309)