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
Super User
Super User

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
Super User
Super User

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
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

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

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,080)