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

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (43,574)