Skip to main content

Notifications

Power Automate - Building Flows
Suggested answer

How to send an outlook email with an excel workbook attachment from a sheet in a shared excel book

(0) ShareShare
ReportReport
Posted on by
Hello,

I am looking to automate an email process that my team does manually everyday. We send this email to the same recipients. 

We currently copy values from a sheet in one of our sharepoint workbooks into a new workbook, save the new workbook locally, and then send the book as an email attachment.

I am looking to build a manual trigger flow that takes the sheet in the existing sharepoint workbook, saves it as as a new workbook (values only and includes tomorrow's date in the workbook name), and then sends the email to the recipients with a subject line that has tomorrow's date in it. (I've figured I can use a function to update the names and subject line with tomorrow's date) 

Please let me know

Thanks
  • Suggested answer
    Nived_Nambiar Profile Picture
    Nived_Nambiar 16,665 on at
    How to send an outlook email with an excel workbook attachment from a sheet in a shared excel book
     
    If you are planning to do this via power automate cloud flows- please keep the following things in mind for prerequisites
     
    1. Power Automate for excel operations requires tables to be created as data via excel actions in power automate cloud flow can be identified via tables constructed within sheets, so recommended to enclose the data in each sheet inside a table and table should have name same as that of sheet in which data resides
     
    2. Also please create a template excel file which contains the sheet having name as required in new workbook and also with same columns serving as a template.
     
     
     
     
    This is the input file created for the demo 
     
    This is the template file created 
     
     
    Now , let start the flow design !
     
    1. Use trigger when file is created 
     
    2. Use get file content to get the content of template file 
     
     
    3. Use create file action to create the file using template file content and with name as tommorow date (name can be changed as per your specification - used for demo purposes)
     
     
    Expression - 
    concat(formatDateTime(addDays(utcNow(),1),'yyyy-MM-dd'),'.xlsx')
     
    4. use list rows action to list all rows in input file 
     
     
    Note: Table name has been written as custom value, it won't appear in table field as dropdown value.
     
    5. use apply to each to loop through the table values and add row to new file created.
     
     
     
     
    Here Note that Table field value is written as custom value
     
     
    Now outside the loop - use a delay action (it is added as sometimes file need to take time to get updated)
     
    Get the file content of the updated file using get file content
     
    Now use send email action to send the email by attaching the attachment as shown below
     
     

    Thanks & Regards,
    Nived N

    Stay connected:
    LinkedIn | YouTube | Blogs

    Was this answer helpful?
    If yes, please mark it as the solution by selecting the checkbox in the discussion thread.
    Your feedback motivates me to keep contributing. Thank you!

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #9 Get Recognized…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,867

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,174

Leaderboard