Hi All,
From searching I see that there are a few questions along these lines. My Camera control works fine, but we also need to have the ability to attach a photograph. I've used the AddPicture control which it appears only saves the image to the devices cache as a appres://blobmanager address? So although it will save the data to the Sharepoint list it can't then be shown in a Gallery as an image at a later time.
Is there any way to convert this to Base 64 similar to the one the Camera function uses?
I've seen some solutions/workarounds online, but to be honest I don't understand them. I know nothing about Flow and have only a rudimentary knowledge of PowerApps.
Kev
Solved! Go to Solution.
Hi @Anonymous ,
Could you please share a bit more about your scenario?
Do you want to convert the appres://blobmanager data into a Base64 data?
Based on the needs that you mentioned, I think the JSON function could achieve your needs. I have made a test on my side, please consider take a try with the following workaround:
Set the OnSelect property of the "Convert" button to following:
Set(BinaryImageData, Substitute(JSON(UploadedImage1.Image,JSONFormat.IncludeBinaryData),"""",""))
Then if you want to save the Base64 data back to your SP List, please use the BinaryImageData variable.
If you use Patch function to patch data back to your SP List, please consider take a try with the following formula:
Patch(
'YourSPList',
Defaults('YourSPList'),
{
...
ImgColumn: Substitute(JSON(UploadedImage1.Image,JSONFormat.IncludeBinaryData),"""",""),
...
}
)
Please consider take a try with above solution, then check if the issue is solved.
Best regards,
Hi @Anonymous ,
Could you please share a bit more about your scenario?
Do you want to convert the appres://blobmanager data into a Base64 data?
Based on the needs that you mentioned, I think the JSON function could achieve your needs. I have made a test on my side, please consider take a try with the following workaround:
Set the OnSelect property of the "Convert" button to following:
Set(BinaryImageData, Substitute(JSON(UploadedImage1.Image,JSONFormat.IncludeBinaryData),"""",""))
Then if you want to save the Base64 data back to your SP List, please use the BinaryImageData variable.
If you use Patch function to patch data back to your SP List, please consider take a try with the following formula:
Patch(
'YourSPList',
Defaults('YourSPList'),
{
...
ImgColumn: Substitute(JSON(UploadedImage1.Image,JSONFormat.IncludeBinaryData),"""",""),
...
}
)
Please consider take a try with above solution, then check if the issue is solved.
Best regards,
Thank you @v-xida-msft
This worked brilliantly! And in fact can replace the camera function I had originally used as it asks user on mobile devices whether they want to take a new picture or add from their device which is even better 🙂
Thanks again
Kev
Cant make this hack work, has there been any changes?
@v-xida-msft
Your suggestion seems to be exactly what I'm looking for: Patching a image which was stored as "appres://Blobmanager..."
Unfortunately I cannot figure out how to make this work for the common data service. Do you know If I need to change any formulas?
Thank you in advance.
@v-xida-msft
Never mind, I figured out how to do it.
Also, now it works with multiple images as I used a collection.
Thanks anyway!!!
@Reinier: Can you share your solution? I am basically struggling with the same issue. I can get the image data to a SP list but not convert it to an actual image i SP or use it in word etc.
Thanks,
Matt
Hi @Mat33 ,
Unfortunately, my solution does not seem to work as good as I would have hoped.
I'm able to patch the images to CDS in my case but the quality is not that good.
However, for the onselect of the "AddMediaWithImage" is use:
Collect(addedMedia, {ID: CountRows(addedMedia)+1 , timestamp: Now(),NCmage2:UploadedImage2.Image } )
The collection can be patched to a database with:
ForAll(
RenameColumns(
addedMedia,
"ID",
"EID"
),
Patch(
'Non-conformance Images',
Defaults('Non-conformance Images'),
{'Non-conformance': Last('Non-conformances')},
{
Name: LookUp(
addedMedia,
ID = EID
).ID
},
{Image: LookUp(addedMedia,ID=EID).NCimage2}
)
)
Hope this helps.
THANK YOU, GREAT SOL.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
184 | |
51 | |
47 | |
32 | |
32 |
User | Count |
---|---|
265 | |
91 | |
78 | |
68 | |
67 |