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 III
Super User III

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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,946)