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!
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.
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)
);
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
Super User 2025 Season 2
mmbr1606
275
Super User 2025 Season 2