cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
laz8592
Helper III
Helper III

Email reminder when a contract is 30 days before expiry

I don't have any experience with workflows or flows. 

 

I would like to create a specific flow that sends automatically an email reminder out to specific users when a sales client contract is due to end 30 days before and must be linked to a column in a document library 'termination date' in sharepoint. The files are scanned into pdf and uploaded one by one on Sharepoint and start and end of contract by date columns are filled in when uploaded. Enterprise metadata is enabled.

 

Is there  a way that once the flow is created and then the day after when the contract ends to move these files to an ‘expired contracts’ folder?

 

How can I easily create this flow please. 

10 REPLIES 10
Bizzo
Kudo Kingpin
Kudo Kingpin

You kind of have 2 questions in here.

 

I would like to create a specific flow that sends automatically an email reminder out to specific users when a sales client contract is due to end 30 days before and must be linked to a column in a document library 'termination date' in sharepoint.

 

I think your best bet is to create a calculated column called EmailReminderDate. This link will give you a bit of info on how to do that, but I think it'll end up something like this: =[termination date]-30.

https://msdn.microsoft.com/en-us/library/office/bb862071(v=office.14).aspx

 

Create a flow that's triggered to run daily (Recurrence).

 

Create a timestamp for "today" (Data Operations - Compose). You might have to format the timestamp to play nice with the rest of the flow. This thread will give you some info and links about timestamps.

https://powerusers.microsoft.com/t5/Building-Flows/Is-there-any-way-to-do-a-timestamp/m-p/50999#M471...

 

Get items from your SharePoint list, and filter the results using EmailReminderDate equals timestamp.

 

Use the Apply to Each option and send out an email for each result (ie. every contract that expires in 30 days) that is returned.

 

Personally, I would probably add 2 other columns, EmailReminderSent and EmailReminderSent_dt, and update those columns when the flow runs successfully. That gives you a bit of extra visibility into what's happening.

 

 

Is there  a way that once the flow is created and then the day after when the contract ends to move these files to an ‘expired contracts’ folder?

 

Create a flow that's triggered to run daily (Recurrence).

 

Create a timestamp for "today" (Data Operations - Compose).

 

Get items from your SharePoint list, and filter the results using termination date equals timestamp.

 

Use the Apply to Each. It looks like you'll have to copy the file to the expired contracts folder and then delete the record in the original document library.

Bizzo thank you for this. 

 

As I am clueless with this, is there a possibility you can send me some screenshots with the details you have stated. Have a look at the columns I currently have for the folder library in the attachment.

 

Columns in doc library.jpg 

 

 

Really sorry. Never got an email when you replied (or I missed it). Do you still need a hand with this? Let me know and I can try and put some pieces together.

Here's your document library with columns and some sample data.

 

document-library-expiring-contracts.PNG

 

document-library-expiring-contracts-column-definitions.PNG

 

NOTE: You cannot use a calculated column to filter results, so EmailReminderDate needs to be set. I defaulted the column to [Today]+335, so I think it still does what you need it to. ContractStartDate defaults to Today, and ContractEndDate defaults to [Today]+365.

 

Your trigger is set to run daily.

 

document-library-expiring-contracts-trigger.PNG

 

Get today's date and format it.

 

document-library-expiring-contracts-date.PNG

 

Get all the contracts that need to send the email reminder today (using the output from above as part of the filter).

 

document-library-expiring-contracts-get-files.PNG

 

Add an apply to each - so for every result returned in the Get files step above, we want to do the same thing. We check if the EmailReminderSent column is equal to "No" (we don't want to send the email more than once). If that condition is true (meaning the email has not been sent), send the email. Get a timestamp, then update the record and set EmailReminderSent to "Yes" and set EmailReminderSentDate to the timestamp.

 

document-library-expiring-contracts-apply-to-each.PNG

 

That will pretty much do it I think.

Let me know how it goes when you use that first example I sent. You didn't reply, so I'm going to hold off on doing the second one until I know you're actually still looking for help with that.

 

Also, I left the apply to each stuff for you to do. Those should be easy enough to figure out.

Thank you Bizzo will try this next week and let you know. 

Sounds good! Looks like I'm getting alerts for this now, so let me know if you have any questions. It won't take me 2 weeks to reply this time! 🙂

Does this really do it because I tried and did not for me. I get this =  "status": 400,
  "message": "The expression \"Due Date eq '11/2/2017'\" is not valid.\r\nclientRequestId: 14c8e303-f6d6-432f-8a4b-2d393e165002",

No. This doesn't work at all and I put all this time into purposely answering questions with incorrect information... SMH

</bitter>

 

In the output for that flow where you read the error message, you should be able to check the format for the column, Due Date. Make sure Due Date actually is returned. Compare the format of Due Date with the way we formatted the timestamp. It might be different for some reason. Start there and let me know what you find.

Thought I would quickly touch base with you and see if you'd had a chance to look into this further. Did it all make sense? Are you still trying to do this?

Helpful resources

Announcements

Celebrating the May Super User of the Month: Laurens Martens

  @LaurensM  is an exceptional contributor to the Power Platform Community. Super Users like Laurens inspire others through their example, encouragement, and active participation. We are excited to celebrated Laurens as our Super User of the Month for May 2024.   Consistent Engagement:  He consistently engages with the community by answering forum questions, sharing insights, and providing solutions. Laurens dedication helps other users find answers and overcome challenges.   Community Expertise: As a Super User, Laurens plays a crucial role in maintaining a knowledge sharing environment. Always ensuring a positive experience for everyone.   Leadership: He shares valuable insights on community growth, engagement, and future trends. Their contributions help shape the Power Platform Community.   Congratulations, Laurens Martens, for your outstanding work! Keep inspiring others and making a difference in the community!   Keep up the fantastic work!        

Check out the Copilot Studio Cookbook today!

We are excited to announce our new Copilot Cookbook Gallery in the Copilot Studio Community. We can't wait for you to share your expertise and your experience!    Join us for an amazing opportunity where you'll be one of the first to contribute to the Copilot Cookbook—your ultimate guide to mastering Microsoft Copilot. Whether you're seeking inspiration or grappling with a challenge while crafting apps, you probably already know that Copilot Cookbook is your reliable assistant, offering a wealth of tips and tricks at your fingertips--and we want you to add your expertise. What can you "cook" up?   Click this link to get started: https://aka.ms/CS_Copilot_Cookbook_Gallery   Don't miss out on this exclusive opportunity to be one of the first in the Community to share your app creation journey with Copilot. We'll be announcing a Cookbook Challenge very soon and want to make sure you one of the first "cooks" in the kitchen.   Don't miss your moment--start submitting in the Copilot Cookbook Gallery today!     Thank you,  Engagement Team

Announcing Power Apps Copilot Cookbook Gallery

We are excited to share that the all-new Copilot Cookbook Gallery for Power Apps is now available in the Power Apps Community, full of tips and tricks on how to best use Microsoft Copilot as you develop and create in Power Apps. The new Copilot Cookbook is your go-to resource when you need inspiration--or when you're stuck--and aren't sure how to best partner with Copilot while creating apps.   Whether you're looking for the best prompts or just want to know about responsible AI use, visit Copilot Cookbook for regular updates you can rely on--while also serving up some of your greatest tips and tricks for the Community. Check Out the new Copilot Cookbook for Power Apps today: Copilot Cookbook - Power Platform Community.  We can't wait to see what you "cook" up!    

Welcome to the Power Automate Community

You are now a part of a fast-growing vibrant group of peers and industry experts who are here to network, share knowledge, and even have a little fun.   Now that you are a member, you can enjoy the following resources:   Welcome to the Community   News & Announcements: The is your place to get all the latest news around community events and announcements. This is where we share with the community what is going on and how to participate.  Be sure to subscribe to this board and not miss an announcement.   Get Help with Power Automate Forums: If you're looking for support with any part of Power Automate, our forums are the place to go. From General Power Automate forums to Using Connectors, Building Flows and Using Flows.  You will find thousands of technical professionals, and Super Users with years of experience who are ready and eager to answer your questions. You now have the ability to post, reply and give "kudos" on the Power Automate community forums. Make sure you conduct a quick search before creating a new post because your question may have already been asked and answered. Galleries: The galleries are full of content and can assist you with information on creating a flow in our Webinars and Video Gallery, and the ability to share the flows you have created in the Power Automate Cookbook.  Stay connected with the Community Connections & How-To Videos from the Microsoft Community Team. Check out the awesome content being shared there today.   Power Automate Community Blog: Over the years, more than 700 Power Automate Community Blog articles have been written and published by our thriving community. Our community members have learned some excellent tips and have keen insights on the future of process automation. In the Power Automate Community Blog, you can read the latest Power Automate-related posts from our community blog authors around the world. Let us know if you'd like to become an author and contribute your own writing — everything Power Automate-related is welcome.   Community Support: Check out and learn more about Using the Community for tips & tricks. Let us know in the Community Feedback  board if you have any questions or comments about your community experience. Again, we are so excited to welcome you to the Microsoft Power Automate community family. Whether you are brand new to the world of process automation or you are a seasoned Power Automate veteran - our goal is to shape the community to be your 'go to' for support, networking, education, inspiration and encouragement as we enjoy this adventure together.     Power Automate Community Team

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Tuesday Tip | How to Report Spam in Our Community

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   Today's Tip: How to Report Spam in Our Community We strive to maintain a professional and helpful community, and part of that effort involves keeping our platform free of spam. If you encounter a post that you believe is spam, please follow these steps to report it: Locate the Post: Find the post in question within the community.Kebab Menu: Click on the "Kebab" menu | 3 Dots, on the top right of the post.Report Inappropriate Content: Select "Report Inappropriate Content" from the menu.Submit Report: Fill out any necessary details on the form and submit your report.   Our community team will review the report and take appropriate action to ensure our community remains a valuable resource for everyone.   Thank you for helping us keep the community clean and useful!

Users online (4,479)