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

How to set up an automatic email with attachment - Excel file on sharepoint to email people at a certain time and day

Hi

 

How do you set up an excel file on a sharepoint to automatically email someone on a certain time and daily?

Can this done through power automate or sharepoint designer?

Thanks

2 ACCEPTED SOLUTIONS

Accepted Solutions
vivekpande18
Impactful Individual
Impactful Individual

Hi @Luna ,

 

Everything is correct, but you are putting the attachment variable in the wrong place. Check below.

 

You are trying to provide the attachment variable below. But it will not work.

 

vivekpande18_0-1656339457874.png

Click on the yellow highlighted icon above. It will open the UI in below format.

 

vivekpande18_1-1656339531964.png

 

Now here you need to provide the variable value.

 

Hope you got this point.

 

Thanks

Vivek

 

 

 

View solution in original post

vivekpande18
Impactful Individual
Impactful Individual

Hi @Luna ,

 

vivekpande18_0-1656387763957.png

 

In the above Attachment variable, 

Name : Display Name (This attribute comes from "Get file metadata" action)

ContentBytes : Body (This attribute comes from "Get file Content" action)

 

Hope you have taken care of it.

 

Thanks

Vivek

 

View solution in original post

10 REPLIES 10
vivekpande18
Impactful Individual
Impactful Individual

Hi @Luna , 

 

You need to send email to users with excel as attachment? 

 

Yes, that is possible. 

Tell us more about it, will try to list down the exact steps to achieve it. 

 

Thanks

Hi @vivekpande18 

Yes, I need to send an email with an excel attachment which is saved to the SharePoint.
This would need to be set up daily at 13:00.

The file name changes weekly so I'm not sure if this will be an issue? If there's a way to send all files within a certain folder that could also work.


Thanks 

vivekpande18
Impactful Individual
Impactful Individual

Hi @Luna ,

 

Please find below steps to achieve your functionality.

 

1- Get all the files  from Folder using List Folder action.

vivekpande18_0-1653038318192.png

 

2- Initialize array variable to store file contents

vivekpande18_1-1653038408990.png

 

3 - Loop over the body got from List Folder action

vivekpande18_2-1653038493643.png

 

File Identifier : items('Apply_to_each')?['Id']

 

4- Send email action after foreach loop 

vivekpande18_3-1653038563746.png

 

Hope this will help you.

 

Thanks

Vivek Pande

 

If this post helps answer your question, please "Accept as Solution" to help others find it more quickly.

If you thought this post was helpful, please give it a Thumbs Up.

 

Hi Vivek

 

I'm having some difficulty with Step 3 - Loop over the body got from List Folder action

Are you able to please explain this further?

Thanks again for your help 🙂 

vivekpande18
Impactful Individual
Impactful Individual

Hi @Luna3 @Luna 

 

vivekpande18_1-1653979711103.png

 

 

vivekpande18_0-1653979631921.png

 

 

Input to apply to each  is coming from List folder action. This will going to loop over all the files present inside that particular folder. If you have 1 file, then 1 attachment json will be created. If there are 2 files, then two attachments json will be created and so on.

 

Get file metadata action is used to get the details related to file. like file name, file extension and other details.

File Identifier : items('Apply_to_each')?['Id']

 

Get file content action is used to get the actual content of the file present.

File Identifier : items('Apply_to_each')?['Id']

 

Append to array variable is used to create attachment json which will be provided in outlook as attachment parameter.

Json :

{
"Name": @{outputs('Get_file_metadata')?['body/DisplayName']},
"ContentBytes": @{body('Get_file_content')}
}

 

Note : You will get the above value inside dynamic content.

 

vivekpande18_2-1653980347761.png vivekpande18_3-1653980381620.png

 

 

Hope you understood !

You can let me know, if you still face any issue.

 

Thanks

Vivek pande

 

If this post helps answer your question, please "Accept as Solution" to help others find it more quickly.

If you thought this post was helpful, please give it a Thumbs Up.


Subscribe to my YouTube channel to get more interesting content on Power Automate.

Luna
Regular Visitor

Hi @vivekpande18 

I'm still having an issue, the attachments are not emailing through correctly.
The folder has 2 excel files in it which is what I need it to email but the comes through with a .tmp file, shown below.

Luna_7-1656306264308.png

 

Luna_8-1656306317836.png

 



Everything else appears ok, let me know if there's anything wrong in these steps.

Luna_5-1656305943970.png


Appreciate your help


vivekpande18
Impactful Individual
Impactful Individual

Hi @Luna ,

 

Everything is correct, but you are putting the attachment variable in the wrong place. Check below.

 

You are trying to provide the attachment variable below. But it will not work.

 

vivekpande18_0-1656339457874.png

Click on the yellow highlighted icon above. It will open the UI in below format.

 

vivekpande18_1-1656339531964.png

 

Now here you need to provide the variable value.

 

Hope you got this point.

 

Thanks

Vivek

 

 

 

Luna
Regular Visitor

Thank you @vivekpande18  Now working 🙂

Luna
Regular Visitor

Hi @vivekpande18 

Apologizes, I have another issue now where the files don't open. 

Luna_0-1656378631905.png

They're coming through as 1KB when they should be 1-2MB

Any ideas on how to fix this?

Thanks 

vivekpande18
Impactful Individual
Impactful Individual

Hi @Luna ,

 

vivekpande18_0-1656387763957.png

 

In the above Attachment variable, 

Name : Display Name (This attribute comes from "Get file metadata" action)

ContentBytes : Body (This attribute comes from "Get file Content" action)

 

Hope you have taken care of it.

 

Thanks

Vivek

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (5,000)