cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jean_9681
Helper II
Helper II

Converting HTML to Image.JPG is not working

I have my HTML in a compose action and i am able to convert it to an HTML file, this HTML file shows the image


However, while trying to convert the HTML file to JPG the image does not show instead the there is white(blank) image with a red x mark on top left corner.

 

What am i missing here ?  - This is what i have in my flow

 

convertfile.png

 

Any suggestions

Thank you,

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Dual Super User
Dual Super User

Hi @Jean_9681,

 

In that case you can use a get file content using path action instead.

 

Also update the expression to this:

concat('data:', body('Get_file_content_using_path')?['$content-type'] ,';base64,',body('Get_file_content_using_path')?['$content'])

 

getfilecontent_usingpath.png

View solution in original post

4 REPLIES 4
Expiscornovus
Dual Super User
Dual Super User

Hi @Jean_9681,

 

What is in your compose action? Is the img src pointing to a hyperlink or are you pointing to a base64 value?

 

If you are pointing to a public image you could try the approach below.

In this example I used the screenshot from your opening post btw 😁

 

concat('data:', body('HTTP')?['$content-type'] ,';base64,',body('HTTP')?['$content'])

 

getfilecontent_base64.png

@Expiscornovus  thanks for the taking the time to help me with this, In my case I am getting an image from SharePoint library..  
My Compose action has <img src pointing to "Link to Item">

Since HTTP action is a PREMIUM  I am not allowed to use this action 😞
Will Send an HTTP request to SharePoint work - since i am getting the image from SharePoint


Expiscornovus
Dual Super User
Dual Super User

Hi @Jean_9681,

 

In that case you can use a get file content using path action instead.

 

Also update the expression to this:

concat('data:', body('Get_file_content_using_path')?['$content-type'] ,';base64,',body('Get_file_content_using_path')?['$content'])

 

getfilecontent_usingpath.png

@Expiscornovus  Thank you so much, this worked 👍

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

Users online (3,707)