Hi,
I'm Hoping someone can shed some light on my problem, I have created an app that uses the camera to take and photo and saves the image data to a sharepoint list, This has been working fine and the images are viewable in a gallery.
However of late I noticed the image data stored on sharepoint is different (see below), and now the new format cannot be viewed.
Old format "data:image/png;base64,i(StingOfCharacters)"
New format "/SessionStorage/PApps(StringOfNumbers).png"
Can someone explain what has caused the change and how to get it back or at least get the images to be viewable again.
I have added a screenshot of both datastrings from sharepoint.
Thanks in advance,
Solved! Go to Solution.
HI @Jissenka ,
Your Patch needs to follow this
With(
{
wJSON:
Substitute(
JSON(
First(colPhoto).Url,
JSONFormat.IncludeBinaryData
),
"""",
""
)
},
Patch(
YourListName,
{YourRecordIdentifier},
{YourFieldName: wJSON}
)
)
I have set this out in this section of my blog on images
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.
Hi @Jissenka ,
What are you using to store the code (I assume JSON conversion). Can you please post the code.
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.
Thanks for the reply,
I have only given the code related to the image, and Changed the real list name for reasons.
if the device is online it is a patch command from the photo collection
Patch(MySharepointList,Defaults(MySharepointList),
{
Image_Data: First(colPhoto_1).Url
}
If offline it collects the data to an offline collection
Collect(
colTaskOffline,{
colImage_Data: First(colPhoto_1).Url
}
And when back online it patches the data from the collection to the sharepoint list
Patch(MySharepointList,Defaults(MySharepointList),
{
Image_Data: colImage_Data
}
Again this code hasn't changed, but the output in sharepoint has. I'm not sure what could have done it
The crux is all I want is an image that is viewable in the app, and best case in a format that can be used external to powerapps (that's the final goal).
HI @Jissenka ,
Your Patch needs to follow this
With(
{
wJSON:
Substitute(
JSON(
First(colPhoto).Url,
JSONFormat.IncludeBinaryData
),
"""",
""
)
},
Patch(
YourListName,
{YourRecordIdentifier},
{YourFieldName: wJSON}
)
)
I have set this out in this section of my blog on images
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.
Thanks WarrenBelz,
that worked, any idea why it would have worked originally then changed?
Thanks @Jissenka ,
I am surprised it worked in the first place - I have always used the JSON "quote stripping" formula provided.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
205 | |
70 | |
51 | |
49 | |
20 |
User | Count |
---|---|
262 | |
120 | |
85 | |
80 | |
68 |