cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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 @Anonymous ,

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 @Anonymous ,

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.

Anonymous
Not applicable

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 @Anonymous ,

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.

Anonymous
Not applicable

Thanks WarrenBelz,

that worked, any idea why it would have worked originally then changed?

 

Thanks @Anonymous ,

I am surprised it worked in the first place - I have always used the JSON "quote stripping" formula provided.

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (4,874)