cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jissenka
Frequent Visitor

Camera Image data changed Format

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,

1 ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

5 REPLIES 5
WarrenBelz
Super User
Super User

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.

Jissenka
Frequent Visitor

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.

View solution in original post

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.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,948)