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

Community site session details

Session Id : jWkJy4Zu4Mn10YwnwDSPmM
Power Apps - Building Power Apps
Answered

Image Encoding with JSON IncludingBinaryData Not Working

Like (0) ShareShare
ReportReport
Posted on 11 May 2023 21:25:02 by 4

Hi all,

 

First time poster, hopefully I can relay my issue.

 

I have built one app where I am using the function JSON to convert an image to base 64 text string with the pen input image to a  variable (See Attached).

With this code:

Collect(collSignPicAttach,{DisplayName: "Driver: " & cboDriverList.Selected.DriverName & ".png", Id:Now() & ".png", Value:piDriverSignature.Image});
Set(varDriverSign, piDriverSignature.Image);
Set(varDriverSignbase64, JSON(piDriverSignature.Image,JSONFormat.IncludeBinaryData));
Set(varDriverPen,false);
Set(varDriverSavedSign, true);

 

But when I try to use something similar with this code: 

 

UpdateContext(
 {
 SelDate: Text(dpTripDate.SelectedDate,"yyyy-mm-dd"), 
 SelTime: Text(TimeValue(Now()),DateTimeFormat.LongTime24),
 ItemNum: CountRows(gallPicsCaptured.AllItems) + 1
 }
);
Set(varBase64Pic,JSON(Self.Image,JSONFormat.IncludeBinaryData));
Collect( collPictures,
 {
 DisplayName: Text(varNewTripID_FS) & "_" & 
 varPest.PestName & "_" & 
 SelDate & "_" & SelTime & "_(" & ItemNum & ").png", 
 Id: Text(varPest.PestID), 
 Value: Self.Image,
 AbsoluteUri: varBase64Pic
 }

);

 

in another app with the same function JSON IncludingBinaryData with the Add Image Control, it gives me "appres://blobmanager/398fd....." text and not the binary data I need for a HTMLText control later in the process.

 

I have tried adding a column with AddColumns function to the collPictures collection with same blobmanager result. As well as placing the variable varBase64Pic in a text label. 

 

Not sure why this app is doing this while the other is giving the expected base 64 data. The only difference that I can think of is that the working app is a pen input control and the app not working is the AddMediaWithImage control. I would think that the 2 controls would process the image the same? Just a guess on my part though. 

I have attached a screen shot of the issue as well.

 

Hoping that it is something simple I am missing or not understanding completely, would really appreciate any help on this.

Thanks!

 

 

  • frontyPro4x Profile Picture
    4 on 18 May 2023 at 01:17:52
    Re: Image Encoding with JSON IncludingBinaryData Not Working

    Hi @timl 

    Thank you for your response,

    I believe you are correct and I may have inadvertently stumbled on that by adding a button outside of the control referring to it with success. It is weird tho, because I was using the "Self.Image" in the "OnSelect Property" of the UpLoadImage1 control without success.

     

    But either way it is working and I really do appreciate you taking the time.

    Thank You again.

  • Verified answer
    timl Profile Picture
    35,227 Super User 2025 Season 2 on 17 May 2023 at 22:35:35
    Re: Image Encoding with JSON IncludingBinaryData Not Working

    Hi @frontyPro4x 

    The AddMediaWithImage control has a child image control which you can see in the Tree View - for example, UploadedImage1. It's this that you need to reference in your call to Set.

    Set(varBase64Pic,
     JSON(UploadedImage1.Image,JSONFormat.IncludeBinaryData)
    );

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete