web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : 5wkCmYv7ZS+i2gp6kn2VXS
Power Automate - General Discussion
Unanswered

export power BI report as PNG, attach it in email body and send it to users dynamically through power automate

Like (1) ShareShare
ReportReport
Posted on 19 Apr 2024 10:28:47 by 8

hi team,

i have created one flow to send power BI report pages as image in mail body to the users based on their RLS dynamically.

for this i have created the following steps.

1. i have created one list of users mails id's on sharepoint. and using get items steps to get those mail id's in my flow.

142_0-1713521004438.png

 

2. after that i have initialized one variable.

142_1-1713521062403.png

3. after that i have applied apply to each action to create one loop. where input is values from the get items step number "1"

142_2-1713521144262.png

 

4. inside the apply to each each loop i have used export to file for power BI reports, where i am doing following things,

4.1 i have defined my workspace , report name, then page visual name, and in identities i am using my user mail id's so that when loop runs it should gone through all the mail id's in the list and export the power BI report as PNG according to their RLS access.

142_3-1713521448675.png

142_4-1713521500914.png

5. after that i am composing my output from the previous step which is step no. "4" by using datauri() function.

142_5-1713521667765.png

6. after that i am using append values to string variable to get the image in my variable which i have defind earlier before apply for each step this is i am doing because if i am initializing any variable inside apply for each then it is giving me error i have checked in forum also , so got this solution to initialize variable first then use append values to string variable step inside the apply for each.

7. after that i am taking the output of step number "6 " in my mail body. but i am not getting image.

please check the screen shot.

 

here is one more thing if i will use append value to string variable action then it will append the images that i don't want

i just want if i have 6 users with different RLS access then my power BI data as image should attach in mail body and should mailed to the users according to there RLS access.

 

i have done enough RnD but i did not get any solution please help me team!!!.

 

 

I have the same question (0)
  • lbendlin Profile Picture
    8,332 Super User 2025 Season 2 on 19 Apr 2024 at 23:55:19
    Re: export power BI report as PNG, attach it in email body and send it to users dynamically through power automate

    Have you considered attaching the png to the email?

    If you really want to embed the image you have to base64 encode it.

    Solved: Adding Image to Body of Send an Email (V2) - Power Platform Community (microsoft.com)

  • 142 Profile Picture
    8 on 22 Apr 2024 at 04:39:37
    Re: export power BI report as PNG, attach it in email body and send it to users dynamically through power automate

    hi sir,

    i want this image should send dynamically to the users,

    for example, i have 5 users and i have implemented RLS for those 5 users based on their role so they are able to see data based on their role in power BI that power BI image i want to embed dynamically in email so user should get data based on their role. i dont want to create 5 flow i want flow where my loop should start with first user to last user so in this case it will run for first user then second user etc.. this thing will be dependent on my number of mail id's in share point list if i have 6 id's then loop should run for 6 times so that each user should get data. i am able to get image in email for single user but if i am using loop then i am not getting image i have used the code which you have given and the another problem is here also i am not able to define variable, please help in this, in simple words i want my power BI image in mail body dynamically should sent to user based on their role by using single flow.

  • lbendlin Profile Picture
    8,332 Super User 2025 Season 2 on 22 Apr 2024 at 17:29:47
    Re: export power BI report as PNG, attach it in email body and send it to users dynamically through power automate

    You need to Base64 encode the result of the export and then embed it as shown in the link.

     

    RLS has already been applied during the export/rendering of the PNG.  From now on it is your responsibility to keep the data safe.

  • 142 Profile Picture
    8 on 25 Apr 2024 at 08:26:42
    Re: export power BI report as PNG, attach it in email body and send it to users dynamically through power automate

    hi sir,

    142_0-1714033477946.png

    can you please check this error,

    142_1-1714033567671.png

    "the execution of template action export to file for power BI report is skipped there are no items to repeat"

  • lbendlin Profile Picture
    8,332 Super User 2025 Season 2 on 26 Apr 2024 at 00:52:10
    Re: export power BI report as PNG, attach it in email body and send it to users dynamically through power automate

    Your "Apply to each" loop is empty. Please check that.

  • 142 Profile Picture
    8 on 30 Apr 2024 at 03:51:00
    Re: export power BI report as PNG, attach it in email body and send it to users dynamically through power automate

    thank you for your support,

    just one more doubt i have.

    in my development of Power BI reports i am giving access to multiple users.

    if one user hold 2 - 3 roles then he is getting combined data, but i want all data separately i saw one field Report filter in the export to power BI file action in power Automate will it help?

    i hope you have understood the problem.

  • lbendlin Profile Picture
    8,332 Super User 2025 Season 2 on 30 Apr 2024 at 11:09:54
    Re: export power BI report as PNG, attach it in email body and send it to users dynamically through power automate

    In the Export to PNG action you can specify the role name.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 788 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 452 Moderator

#3
developerAJ Profile Picture

developerAJ 302

Last 30 days Overall leaderboard
Loading complete