Forum Discussion
T150732D
Jul 26, 2022Copper Contributor
Azure logic app - sent a visalized graph via email
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 fin...
anish833
Jan 16, 2024Copper Contributor
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:image/jpeg;base64, @{body('Run_query_and_visualize_results')?['attachmentContent']}\" alt=\"Pie Chart\" width=\"80%\" height=\"140%\">
Change the : 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
sentineladmin
Jan 17, 2024Copper Contributor
Thank you for the reply! We will look at this real soon and check back.