web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to Parse JSON an U...
Power Apps
Unanswered

How to Parse JSON an URL Image

(0) ShareShare
ReportReport
Posted on by 23

@v-xida-msft 

Hello every body,

I have a problem, where I want to save a photo label to a SharePoint Document. I got the photo of the label using the Labelary API by filling in a few parameters so that it fits my needs. But I'm confused about exporting it to SharePoint Document, because when I press a button, the result from Parse JSON only produces the same URL instead of base64 code.

Here's my On Select properties on my button:

 

 

Set(varImageJSON, JSON(Image2.Image, JSONFormat.IncludeBinaryData))

 

 

My Image properties on my Image:

 

 

"http://api.labelary.com/v1/printers/8dpmm/labels/1.9685x0.984252/0/%10CT~~CD,~CC%5E~CT~%20%5EXA~TA000~JSN%5ELT0%5EMNW%5EMTD%5EPON%5EPMN%5ELH0,0%5EJMA%5EPR4,4~SD15%5EJUS%5ELRN%5ECI0%5EXZ%20%5EXA%20%5EMMT%20%5EPW400%20%5ELL0200%20%5ELS0%20%5EFT14,38%5EA0N,28,28%5EFH/%5EFDEmployeeID:%5EFS%20%5EFT14,126%5EA0N,28,28%5EFH/%5EFDName:%20%5EFS%20%5EFT14,176%5EA0N,28,28%5EFH/%5EFDPosition:%5EFS%20%5EFT302,106%5EBQN,2,4%20%5EFDLA,0715%5EFS%20%5EFT111,84%5EA0N,28,28%5EFH/%5EFD0715%5EFS%20%5EFT114,126%5EA0N,28,28%5EFH/%5EFDJohanness%5EFS%20%5EFT114,176%5EA0N,28,28%5EFH/%5EFDMarketing%20Manager%5EFS%20%5EPQ1,0,1,Y%5EXZ"

 

 

 

I hope you guys can help me. I will really appreciate. I also attached some photos for help. Thanks.

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    Take a look at this video by Shane Young.  He walks through the process.

    https://youtu.be/RFZfvTuDmP0 

  • Bivan Profile Picture
    23 on at

    @Pstork1 Thank you very much for your fast response. Putting aside the first to upload to Share Point Documents, now I only need the base64 code from the image with the URL.

    But the method used to get the base64 code is the same as Shane Young's, but I don't get a value like:
    "data: image / png; base64, {The Code}"
    , but only returns a URL (not a blob) value like:
    "http://api.labelary.com/v1/printers/8dpmm/labels/1.9685x0.984252/0/(EncodedZPLCode} ", below I attached a gif to show my problem. Why did this happen?, please help me.  Thank you.

  • Verified answer
    Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    Sorry, that reply was actually posted to the wrong thread.

     

    The problem is that you are setting the Image property to make a call to a REST service and the image that is returned is displayed in the image control.  Its the JSON that is returned that you actually need to be able to parse.  But since you are calling an API to get it that isn't stored in the control.  But if you pass that API to a flow the flow can invoke the REST call and will get back the resulting IMAGE JSON.  You can then parse it and save it as a document.  Here's a screenshot of a simple test with your sample API

    image.png

    And this is what the return values look like in flow.

    image.png

    The $content is the base64 encoded file contents of the image.  To save that as a file in OneDrive use the following formula

    base64ToBinary(body('HTTP')?['$content'])

     

  • Verified answer
    Bivan Profile Picture
    23 on at

    Thank you very much @Pstork1 for your help, sorry for my slow response but finally I can modify it, so I can print the image without having to save it first on One Drive or Sharepoint Document, by using 2 HTTPs Connector.

  • agiannakis Profile Picture
    16 on at

    Hi, i want to make the opposite, i have a url of the survey camara that when you invoke  http://192.168.1.5:9988/onvif/media_service/snapshot snapshot is a jpg fo a photo taken i want to put it in a image control in powerapps how can i do that

  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    Please post this as a new question.  You'll get more responses and others will be able to find the answer more easily later.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard