cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ana123
New Member

Power Automate - Automatize e-mails - Contracts end dates

Hello, I'm a new user in Power Automate, I have one list on SharePoint where I have the start date and end date of one Contract. I would like to automate. Send one automatic e-mail 30 days before the end date asking to the manager if the contract will be reniew or not.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Rhiassuring
Community Champion
Community Champion

Hi there, 

I will assume your SharePoint list has these fields:

 

ContractTitle - ContractContact - StartDate - EndDate

 

Here are the steps you need to take:

 

Step 1 - Use a scheduled trigger that will run once a day. 

Rhiassuring_0-1649910653108.png

 


Step 2 - Use a "Get Items" action and set the filter to:  EndDate eq 

formatDateTime(addDays(utcNow(),30),'M/dd/yyyy')

⚠️If you've never added in this kind of filter before, here's how: 
  • Type in EndDate eq ''
  • Click between the two 's you've typed, then click on Expression on the box to the left (a tab). Paste in the formula formatDateTime(addDays(utcNow(),30),'M/dd/yyyy'). Press "OK"

ℹ️ What is the formula doing? The formula is taking "utcNow" to identify "hey, what day is it?". Working our way out of the brackets, the next thing we're doing is identifying "okay - we now know what "today" is - what is 30 days from now?". Once we have that, we need to change the date into a format that SharePoint will understand.


Step 3 - Everything else is honestly magic - add in a "Send an Email" action. Click in the "To" field and click on "Add Dynamic Content" from the bottom right hand side of the field. All the email addresses available from your list will be there! Click on ContractContact Email. You will see the email action automatically turn into an "Apply to each", which just means - hey, if we check Today + 30 and there's more than one contract with an End Date of that, we're going to email for each one.

Step 4 - Type out your email body, and, you're done! And you can use variables from the rest of your Get Item options -- the "Apply to each" that automatically applied makes it so it will always know which contract to pull the information from.

 

In the end, we have something like this:

 

Rhiassuring_1-1649911539691.png

Let me know if you have any questions.

 

Cheers,

 

Rhia

View solution in original post

Thank you so much its working 🙂

View solution in original post

2 REPLIES 2
Rhiassuring
Community Champion
Community Champion

Hi there, 

I will assume your SharePoint list has these fields:

 

ContractTitle - ContractContact - StartDate - EndDate

 

Here are the steps you need to take:

 

Step 1 - Use a scheduled trigger that will run once a day. 

Rhiassuring_0-1649910653108.png

 


Step 2 - Use a "Get Items" action and set the filter to:  EndDate eq 

formatDateTime(addDays(utcNow(),30),'M/dd/yyyy')

⚠️If you've never added in this kind of filter before, here's how: 
  • Type in EndDate eq ''
  • Click between the two 's you've typed, then click on Expression on the box to the left (a tab). Paste in the formula formatDateTime(addDays(utcNow(),30),'M/dd/yyyy'). Press "OK"

ℹ️ What is the formula doing? The formula is taking "utcNow" to identify "hey, what day is it?". Working our way out of the brackets, the next thing we're doing is identifying "okay - we now know what "today" is - what is 30 days from now?". Once we have that, we need to change the date into a format that SharePoint will understand.


Step 3 - Everything else is honestly magic - add in a "Send an Email" action. Click in the "To" field and click on "Add Dynamic Content" from the bottom right hand side of the field. All the email addresses available from your list will be there! Click on ContractContact Email. You will see the email action automatically turn into an "Apply to each", which just means - hey, if we check Today + 30 and there's more than one contract with an End Date of that, we're going to email for each one.

Step 4 - Type out your email body, and, you're done! And you can use variables from the rest of your Get Item options -- the "Apply to each" that automatically applied makes it so it will always know which contract to pull the information from.

 

In the end, we have something like this:

 

Rhiassuring_1-1649911539691.png

Let me know if you have any questions.

 

Cheers,

 

Rhia

Thank you so much its working 🙂

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 (4,546)