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 

 

T150732D_0-1658848594851.png

T150732D_1-1658848643432.png

 

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

T150732D_2-1658848715780.png

 

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

T150732D_3-1658848765764.png

 

 

can you please help me

 

8 Replies

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

@T150732D 

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: https://powerusers.microsoft.com/t5/Building-Flows/Append-Consolidate-HTML-Tables-for-summary-email-...

@T150732D 

 

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.

@sentineladmin 

 

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

@anish833 

 

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.

@sentineladmin 
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 - 

@{base64ToString(body('Run_query_and_visualize_results')?['attachmentContent'])}

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.