cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

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
Highlighted
Super User II
Super User II

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
Highlighted
Super User II
Super User II

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
Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

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

Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Top Solution Authors
Users online (5,048)