web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Email reminder when a ...
Power Automate
Unanswered

Email reminder when a contract is 30 days before expiry

(0) ShareShare
ReportReport
Posted on by 132

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. 

Categories:
I have the same question (0)
  • Bizzo Profile Picture
    212 on at

    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#M4711

     

    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.

  • Laz8592L Profile Picture
    2 on at

    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 

     

     

  • Bizzo Profile Picture
    212 on at

    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.

  • Bizzo Profile Picture
    212 on at

    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.

  • Bizzo Profile Picture
    212 on at

    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.

  • Community Power Platform Member Profile Picture
    on at

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

  • Bizzo Profile Picture
    212 on at

    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! 🙂

  • ediscacciati Profile Picture
    2 on at

    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",

  • Bizzo Profile Picture
    212 on at

    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.

  • Bizzo Profile Picture
    212 on at

    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?

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard