Showing results for 
Search instead for 
Did you mean: 
Regular Visitor

Send e-mail with chart and rows from excel file in One Drive For Business



We plan to sending e-mail with chart and rows from excel file in One Drive For Business.


And also need to refresh all query in excel file.


Please reply if it is possible.


Thank you.

Community Support
Community Support

Hi @Euihwan,


How do you want to send email with chart and rows from excel file in OneDrive for Business folder?

Do you want to save the chart and rows from excel file in OneDrive for Business into Body of the email or save them as attachments of the email?


I assume that you want to save the chart as attachments of the email and save the rows from excel file in OneDrive for Business into Body of the email. I have made a test on my side and please take a try with the following workaround:

  • Add a proper trigger, here I use Flow Button trigger.
  • Add a "Get file metadata" action, specify your chart within File field of "Get file metadata" action.
  • Add a "Get file content" action, specify your chart within File field of "Get file content" action.
  • Add a "Compose" action, Inputs set to following array data:14.JPG

    Note: There is one element within this array data, which is a json data. There are two elements within this json data, the key of first element set to Name and corresponding value set to DisplayName dynamic content of "Get file metadata" action, the key of second element set to ContentBytes and corresponding value set to following formula:

  • body('Get_file_content')?['$content']
    Add a Variables-> "Initialize variable" action, Name set to OriginalArray, Type set to Array and Value set to output of "Compose" action.
  • Add a "Get rows" action, specify your excel file in OneDrive for Business folder.
  • Add a "Create HTML table" action, From set to output of "Get rows" action.
  • Add a "Send an email" action, Body set to output of "Create HTML table" action, Attachments field set to OriginalArray variable and Is HTML set to Yes.

Image reference:15.JPG



The flow works successfully as below:17.JPG





Refreshing all query in excel file is not supported in Microsoft Flow currently, if you would like this feature to be added in Microsoft Flow, please submit an idea to Flow Ideas Forum:


Best regards,



Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



Thanks for your reply.


I think more discripsions will be needed.


1. I need to get chart from excel file, not from image file. Is it possible? or extract chart image from excel file.

2. If it is possible, I want to write mail body with some words and that chart like below image.





Best regards


Not applicable

Yes, this is possible. If you use microsoft graph api calls you can generate an image from a graph and it is returned as a base64 string. You can then use that in the body of the email.


can you elaborate on how to set up the flow to look at an excel file in sharepoint and pull a specific chart?

@v-xida-msft  Thank you, this worked perfect for me but I'm trying to remove the extra colums that got added the @odata.etag and the ItemInternalId , I don't want those to appear in the email.

Hi Kris @v-xida-msft 


Thank you for this solution. I tried this today, but got an error while initializing the variable. 

Action 'Initialize_variable' failed
Also, the function get rows is no longer available, so i am trying it with get tables. My intent is to get charts/graphs from the excel to mail. 
Can you please help me find a solution.

Helpful resources

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,810)