web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Photo Powerapps - Base64
Power Apps
Answered

Photo Powerapps - Base64

(0) ShareShare
ReportReport
Posted on by 308

HI I have a list in sharepoint to show and save photos to use in powerapps. The column that save image in base64. I have a lot of other photos that i want to add to sharepoint list. I converted one photo online and i did great. But I have a lot of photos. I created a file in excel and put a function in powerquery to convert photos from onedrive folder. Didn't work.

 

The function is:  = (BinaryContent as binary) as text=> let Base64 = "data:image/jpeg;base64, " & Binary.ToText(BinaryContent, BinaryEncoding.Base64) in Base64

 

excel file:

 

alessandramaced_0-1602342568953.png

 

Don't show any error but don't show image in app. The formula in app is:

Filter(Fotoapp;IDEnd=Gallery3_1.Selected.Idend)
to save photos the bottom is: 
Collect(Fotos_APP;{Title:"001";IDEnd:Gallery3_1.Selected.Idend;FotoTirada:Camera2.Photo})

 

I need to create another screen to upload photos. Anyone knows the easiest way to do it?

I tried with flow model but shows error in email part.

 

Thanks in advance.

 

Categories:
  • WarrenBelz Profile Picture
    156,526 Most Valuable Professional on at

    Hi @alessandramaced ,

    I have done a a blog on managing images in Power Apps and although SharePoint focussed should work in Excel (although I have never tested it). Have a look at the syntax for saving in a Multiline text field (just get rid of the leading and trailing quotes and save the rest of the text) and a little further down the syntax for viewing (simply refer to the control content name).

     

    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.

     

  • alessandramaced Profile Picture
    308 on at

    @WarrenBelz 

    Thanks a lot for reply. Gread blog! Congrats!

     

    I live in brazil, portuguese language, here powerapps uses ";" instead ",".

     

    The formula is shwoing error in final:

     


    With(
    {
    vJSON:
    With(
    {
    vJSONI:
    JSON(
    First(Fotos_APP).Url;
    JSONFormat.IncludeBinaryData
    )
    };
    Mid(
    vJSONI;
    Find(
    ",";
    vJSONI
    ) + 1;
    Len(vJSONI) -
    Find(
    ",";
    vJSONI
    ) - 1
    )
    )
    };
    'Foto-Powerapps'.Run(TextInput2.Text;
    vJSON;
    Gallery3_1.Selected.Idend
    )
    )
     
     
    It's saying that  expected 2 arguments and I'm using 3.
    I don't know what to chance
     
    Is that possible to put in formula to add ".jpg" to name?
    Thanks in advance
  • WarrenBelz Profile Picture
    156,526 Most Valuable Professional on at

    Hi @alessandramaced ,

    The error in the Flow run will depend on what you are sending it. I assumed that you would simply be patching the value to Excel ( so you do not need a Flow) and was guiding you on the syntax for the Base64 text, however what are the three parameters you are sending the Flow. The second is obviously the JSON text, but which of the first (a text input) and the third (a gallery item value) is the file name? Also to add the extension, simply concatenate it on the end 

    TextInput2.Text & ".jpg"

    as an example on the first one.

     

    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.

  • alessandramaced Profile Picture
    308 on at

    I’m not using excel anymore.

    I did it equal to your example in blog.

    Only sharepont list and I will use camera and upload. And a sharepoint colletion as you did it

    Using same solution for both as you say in blog.

    I did equal to blog and is showwing thia error

    Do you image why?

     

     

  • WarrenBelz Profile Picture
    156,526 Most Valuable Professional on at

    @alessandramaced ,

    You should have three parameters to pass to the flow.  I also assume you are using a SharePoint Document Library.

    1. The file name
    2. The Base64 Text
    3. The Identifier of the record in SharePoint the image belongs to.

    Did you follow the steps for the Flow (particularly 2 & 3)?

    1. The SharePoint Create File action selected and the Site and Folder chosen
    2. Ask in Power Apps chosen for both the File Name and File Content
    3. Delete the File Content reference and replace with the Expression
      base64ToBinary(triggerBody()['Createfile_FileContent'])
    4. Next step - SharePoint Update File Properties with Site and Library chose

     

    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.

  • alessandramaced Profile Picture
    308 on at

    @warrenBelz

     

     

    @WarrenBelz 

     

    here is my bottom :

     

    With(
    {
    vJSON:
    With(
    {
    vJSONI:
    JSON(
    First(colPhoto).Url;
    JSONFormat.IncludeBinaryData
    )
    };
    Mid(
    vJSONI;
    Find(
    ",";
    vJSONI
    ) + 1;
    Len(vJSONI) -
    Find(
    ",";
    vJSONI
    ) - 1
    )
    )
    };
    'Foto-Powerapps'.Run(
    NomeFoto.Text & ".jpg";
    vJSON;
    Gallery3_1.Selected.Idend
    )
    )
     
     
    The error is in red part. 
    Foto_Powerapps is my flow:
    flow.PNG
     

    Data_image is a library in sharepoint where will be the taken and uploaded photos :

     

    data_image-LIbrary.PNG

     

     

     

     
     

    Gallery_3_1 is gallery in powerapps form.

     

    My screen is powerapps:

     

    poweraapps_screen.PNG

     

    I really don't know what is wrong.

     

    Do you know what it is?

     

    regards

     

     

     

  • Verified answer
    WarrenBelz Profile Picture
    156,526 Most Valuable Professional on at

    @alessandramaced ,

    You have not followed the process where highlighted

    base64Flow.png

    The data is an Expression - you need to (as noted last post)

    1. Ask in Power Apps chosen for both the File Name and File Content
    2. Delete the File Content reference and replace with the Expression shown
      base64ToBinary(triggerBody()['Createfile_FileContent'])

    Your result will look like this (ignore the highlighted comment - it is only to show the expression content).

    Base64FlowCorrect.png

     

    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.

     

  • alessandramaced Profile Picture
    308 on at

    Now it did great. It was a problem if translation in automate.

    Thank you very much!!!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 394 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

Last 30 days Overall leaderboard