cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Euihwan
Level: Powered On

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.

5 REPLIES 5
Community Support Team
Community Support Team

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

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.
Euihwan
Level: Powered On

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

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.

ericramos2017
Level: Powered On

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

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

 

nedwards87
Level: Powered On

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

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

montezbell
Level: Power Up

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

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

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 355 members 5,650 guests
Please welcome our newest community members: