I have an "AddMedia" control in a form. I then need to convert that picture to base64 to store in my Sharepoint list.
So far I've tried the following in the "OnSelect" field, but both just set the variables "ImageBinaryRaw" and "ImageBinary11" to null....
Set( ImageBinaryRaw, JSON( UploadedImage1.Image, IncludeBinaryData ) ); Set( ImageBinary11, Mid( ImageBinaryRaw, Find( ",", ImageBinaryRaw ) + 1, Len(ImageBinaryRaw) - Find( ",", ImageBinaryRaw ) - 1 ) )
Set( ImageBinaryRaw, JSON( UploadedImage1.Image, JSONFormat.IncludeBinaryData ) ); Set( ImageBinary11, Mid( ImageBinaryRaw, 24, Len(ImageBinaryRaw) - 24 ) )
So, I tried setting the variable using "User().Image" and that worked. I guess I've got to do some troubleshooting with the add image control...
Thanks @StalinPonnusamy !
The frustrating part is that I have the exact same setup working perfectly fine in another app...
Okay this is interesting...
After some testing, I found the issue is only if the referenced control (UploadedImage1 in this case) or the button being pressed is in a data card on a form. If the control and button are in the root of a screen, it works fine.
I'm not sure why this would be though... Especially because it works fine in another app.... Is there like a setting or a data protection thing I'm missing?
its like the edit form cant interact with anything else in the app:
Here I have an image control selected. The image is set to "UploadedImage.Image" which is the Image from the "Add Media" control on the datacard within the form. The Selected image is not in the editform. As you can see the selected image is blank, while the image in the datacard is not...
I don't we can reference an image from another image control. But we can convert the image to JSON and save it to a datasource.
The issue I was having here was solved in this post: