cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

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

Hello

 

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.

6 REPLIES 6
Highlighted
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

 

16.JPG

The flow works successfully as below:17.JPG

 

18.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:

https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas

 

Best regards,

Kris

 

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.
Highlighted

Hi 

 

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.

 

20180202_191609.jpg

 

 

Best regards

Euihwan.

Highlighted
Anonymous
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. 

 

https://docs.microsoft.com/en-us/graph/api/chart-image?view=graph-rest-1.0

 

Highlighted

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

Highlighted

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

Highlighted

Hi Kris @v-xida-msft 

 

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

Error
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.
Thanks.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (4,074)