Azure logic app - sent a visalized graph via email

Copper Contributor

I am using Logic app to send query outcome via email. I found article how to compose logic app that will use 5 queries (4 charts and 1 table). I would like to send them via email. The queries are fine, visualize data well. However when sending email it only renders the table.


I am wondering if there is any additional processing that i have to add 





It generates in the email only the HTML table, not the image of graphs that are normal timechart or pie chart.



If i try to send just one chart it still does not sent through




can you please help me


8 Replies

@T150732D Hi, did you ever figure out how to do this? I'm having the same issue. 


If you have not yet figured out yet, go to code section and remove base64tostring from the section

You might want to create a Do While and append to it, akin to what was done in this post:



Did you ever get this figured out? We are having the same issue. I saw the comment from Jysk0, who said to remove base64tostring but do not see where to do that. Any help would be appreciated.



From the logic app code view you can edit the query part to include img tag with the output of the KQL query. The MIME type I used was jpeg and it worked for me



Thank you for the reply. Can you include your query and possibly explain that a bit more. We did get the email attachment working but not in the body.

In the logic app code view you can go to the "Send_an_email_(V2)" body where the pie chart (Add attachment content for any graph you want) in the  query will be visible. From there you have to remove the base64 conversion, and add the img tag as below, the MIME type will be jpeg as shown, the kql displays charts in jpeg
Previous Query - 


Modified Query -<img src=\"data&colon;image/jpeg;base64, @{body('Run_query_and_visualize_results')?['attachmentContent']}\" alt=\"Pie Chart\" width=\"80%\" height=\"140%\">

Change the &colon; to actual colon
You can adjust height and width as you see fit.
Note: You might get some random base64 string, for this just make sure you have checked the logic app code view for any syntax error and every time you will make change to the email content , it will mess up the img section, you have to manually change the query back to as shown in modified query.

Hope this helps

Thank you for the reply! We will look at this real soon and check back.