Skip to main content

Notifications

Power Automate - General Discussion
Unanswered

Export To File for Power BI Reports PNG in email body

(0) ShareShare
ReportReport
Posted on by

Hello everyone,

 

I would like to put a PNG of my data report in email body. Is it possible? If yes, how to do it? When you push data report to certain collaborators, they need read fast and they don't have time to open an attachment...

 

Thank you in advance. 😉

  • HazechanAB Profile Picture
    HazechanAB 20 on at
    Re: Export To File for Power BI Reports PNG in email body

     Thanks @Azim_ahmad8  and @yashjlad for the explanation. 

    I have configured the power automate flow successfully.

     

    Just one more point to add, i tried Dynamic Content in the email body but it cannot shows my picture, and i have figured out another way to do it:

     

    I copied the statement and paste in the body content, and it works:

     

    HazechanAB_0-1718677842085.png

     

     

  • HazechanAB Profile Picture
    HazechanAB 20 on at
    Re: Export To File for Power BI Reports PNG in email body
    Yes subscription will be easier for regular scheduled update, but if you want to send "ONLY" when the measure reach the threshold, then Alerts+ power automate can help
  • yashjlad Profile Picture
    yashjlad 4 on at
    Re: Export To File for Power BI Reports PNG in email body

    The above answer by @Azim_ahmad8  is very accurate. It just needs one change when you initialize the variable, use the text from the image he put and not from what he pasted in the third bullet part. I was making that mistake and instead tried using this:

    <img src="data&colon;image/jpeg;base64,@{outputs('Export_To_File_for_Power_BI_Reports')?['body'].$content} " alt=" my file" />

    It works perfectly. Thanks @Azim_ahmad8 for the brief explanation. 

  • Azim_ahmad8 Profile Picture
    Azim_ahmad8 11 on at
    Re: Export To File for Power BI Reports PNG in email body

    Hi @Anonymous ,

    I found an interesting link that might be related to the answer posted by @Mister_Shaik, this is the link
    https://mohitvash.wordpress.com/2020/09/06/power-automate-embed-an-image-in-an-email/ 

    However in this example, the report source is the Sharepoint folder, you can do slight modification on top of this solution,
    So Im sharing with you my work around:
    1. I set the trigger using "Recurrence" trigger where I set the email will be automatically sent when the time is as specified (eg: 7AM)

    2. Then I used "Export To Power BI Reports" to get the report in certain format that I preferred (in my case its .PNG), however you
    # Must know at this current stage the image/file exported is in Binary format or base64 format, or other format Im not so sure
    # But the point is, its not an image yet (Unless you add the image as attachment than it will work)
    # For the case of wanting to include the image directly in email body, you must later add the image using HTML image tag as mentioned by @Mister_Shaik, we can do that using "Initialize Variable" action

    3. Add "Initialize Variable" action to your flow, as mention in the link I attach earlier, you should
    # first give the name for your variable (later to referred to when choosing the content in final step) like in the example its "ImageTag",
    # secondly for the type please choose the string,
    # thirdly in the "Value" part please type
    "<img src="data&colon;image/jpeg;base64, " alt="alert" />"
    # then click between 'base64, ' and '" alt="alert"' 
    # then click the "Expression" pop up, and in the text box write ".$content"
    # then click on the left side of the "." in the ".$content", and click "Dynamic Content"
    # then choose your exported report, type "File Content" in the text box
    # and press "okay", the end result should be like this 

    Azim_ahmad8_0-1679906619577.png

    # For each image/file content you should have separate "Initialize Variable" actions

    4. Add new action, in the text box type and select "Send an Email",
    # first add the email you wanted to send the email to and the subject
    # next you should change the body part of the email to be formatted as HTML
    # to do so, you should click at the "Send an Email" action tag, and look at the "Body" part and click the "</>" button

    powerautomate.png

    # after you click it, the format should be in HTML format, like below

    Azim_ahmad8_1-1679907021292.png


    # Then click somewhere in the HTML tag, click "Dynamic Content" and look for "ImageTag" or any other name that you give in step 3
    # if the content is successfully added it should look like this,

    Azim_ahmad8_2-1679907303246.png


    5. Final step is to save and test your flow, if the flow is okay you should receive an email with the image included in the body of the email. If you encounter any error, debug the issue based on the error raised first and use the setting I mentioned, it should work

    Sorry for the lengthy post, hope it is useful for others. If I did mention any wrong step please add in the comment, thanks.

  • CMathisen Profile Picture
    CMathisen 4 on at
    Re: Export To File for Power BI Reports PNG in email body

    If you use Subscriptions you can choose to include a preview image.

  • Re: Export To File for Power BI Reports PNG in email body

    Hi Vincent,

    Did you find the answer? it would be great if this is possible.

  • Re: Export To File for Power BI Reports PNG in email body

    Hi @Mister_Shaik,

     

    Thanks but I would like to use API "Export To File for Power BI Reports" (.png) by mail without attachement but embed in body Email. Is-it possible ? Or am I have to use to store my .png on sharepoint/sharepointlist and take it everytime ?

     

    Thank you for your time.

  • Mister_Shaik Profile Picture
    Mister_Shaik 1,006 on at
    Re: Export To File for Power BI Reports PNG in email body

    Hi @Anonymous ,

     

    If you just want to include a image in your email body, then you can use a img tag with src pointing to the base64 content instead of a link.

     

    <img src="data&colon;image/png;base64,#yourBase64ContentHere" />

     

    I've used this to embed images in many of my flows, and the image can be static like something from a SharePoint library or dynamic, like something from a form/list submission.

     

    Hope this helps 🙂


    Kind Regards,

    Shaik Sha
    ________________________________________________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,580

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,909

Leaderboard