cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MetodioTrend
Level: Powered On

Images converted to string when using Parse JSON

Dear friends,

First of all, many thanks for all of the PowerApps/Flow tutorials and debugs you guys do everyday! Those help A LOT!

I have a specific situation here that stops me from continuing my project and I've been stuck for the last several days.

Basically, I want to export a collection (that contains strings, booleans and images(out of a pen input)) from Apps to Flow and then put that collection into a parsed html code and then convert that to a pdf file. I followed videos for that specific case, but as the logic and the elements requiered in my project are more complex that just the table, I need to do the operations in Flow, rather than generating the final html in a PowerApps hidden screen.

I tried two things:

First, I used the JSON function and everything worked perfectly well except for the part where my images are sent as a type:image/png but are converted in the Flow JSON Parse function into a type:text/plain . This means that I lose completely my images and don't know how to deal with this. I specified the JSONformat.IncludeBinaryData and I respected everything said in the PowerApps JSON tutorials on the web.... Any suggestions?

Here is the proof my Collection's JSON is send with binaries, where SIGNATURE is indeed an image type (sorry it's in French :X 😞
Capture.PNG

Here's the part where I convert that to URI:
Capture1.PNG

And here's the proof the type is changed to text into the html file created with Flow:
Capture2.PNG

Now, it is important to know that I input the Collection data into an initialised string variable. And then, when I create the JSON parsing model by pasting the JSON(Collection, JSONFormat.IncludeBinaryData) output, the class SIGNATURE is recognised as a string type, not image. When I change that to image, an error occurs saying that's not the correct type..

EDIT:
Well it seems that by opening the .html file with VS Code, the types are said to be text/plain. However, when opened in Mozilla-> left click on image -> show image , we can see that the element is indeed a data:text/plain type but stores the original data:image/png information. Gosh I feel so close to the solution...

Capture3.PNG


Thank you very much!

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Images converted to string when using Parse JSON

Hi @MetodioTrend 

Looking at your screen shots... the 'SIGNATURE' field in your JSON is already in the correct format, so therefor you don't need to pass it back through the dataUri epxression.

 

2019-10-22_20-13-49.png

 

The reason it's coming out as a string is because you are passing it a string .

 

Cheers J

View solution in original post

1 REPLY 1
Super User
Super User

Re: Images converted to string when using Parse JSON

Hi @MetodioTrend 

Looking at your screen shots... the 'SIGNATURE' field in your JSON is already in the correct format, so therefor you don't need to pass it back through the dataUri epxression.

 

2019-10-22_20-13-49.png

 

The reason it's coming out as a string is because you are passing it a string .

 

Cheers J

View solution in original post

Helpful resources

Announcements
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,661)