Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Sending email notification 10 days before the expiry date in power automate?

(0) ShareShare
ReportReport
Posted on by 127

I have the following Sharepoint online list( data is sample);  a user should get a notification email  10 days before the expired date of the issued driving  permit.

I  want to automate this using  power automate. a user must get an email notification before 10 days of the "expireddate" date.

the email format will be something like this:

Hello firstname,

Your driving permit was issued on "issuedate" and  will be expired on "exipreddate".

Kindly issue new one!

--------

 

firstnamelastnameemailuseridissuedateexpireddatestatus 
MeazaHagosmeaza@mysite.commeazahaOctober 11,2020November 05,2023active 
HelenMikehelenmike@mysite.comhelenmApril 20,2022October 15,2023Active 
PetrosHailepetrosh@mysite.competrosAugust 15,2023December 25,2023active 
JohnGebrejohngebre@mysite.comjohngebreJuly 28,2023October 30,2023active 

 each user receives email only  about his own information when the 10 days to go to expire.

how can I do this, any hints?

your help is appreciable!

  • Sebey Profile Picture
    127 on at
    Re: Sending email notification 10 days before the expiry date in power automate?

    I added a get item list above the condition then use the  expression on the condition, it works fine now.

    Sebey_0-1697807210485.png

     

  • Sebey Profile Picture
    127 on at
    Re: Sending email notification 10 days before the expiry date in power automate?

    int(first(split(dateDifference(utcNow(),items('Apply_to_each_2')?['expireddate']),'.')))

    Now I Understand the date calculation is working fine but as long as the condition is true, it sends notification to all users.

    User 3: number of days remaining for expiry date=10 [ email sent]

    Sebey_2-1697799079524.png

    user 2: number of days=8 but notified

    Sebey_3-1697799185824.png

     

     

    user 3, date difference is 78 but got notified:

    Sebey_1-1697798816573.png

     

    The email sends to all users, whenever the condition becomes true, I want to send notifications only to the user whose condition is true!

    I appreciate all your supports!

     

  • v-mengmli-msft Profile Picture
    on at
    Re: Sending email notification 10 days before the expiry date in power automate?

    Hi @Sebey ,

     

    What type is 'exipredate'?

    Add a compose to check the output of expression:

    vmengmlimsft_0-1697789078678.png

     

  • Sebey Profile Picture
    127 on at
    Re: Sending email notification 10 days before the expiry date in power automate?

    here is the follow:

    today is: 20/10/2023

    exipreddate: 30/10/2023

    since the gap is 10 days, email is expected for the user, but still i tried both of your expressions  and the follow doesnot give error, but it always provide false conditions

    Sebey_0-1697787194781.png

    condition expression as per your solutions, I tried both

    div(sub(ticks(utcNow()),ticks(items('Apply_to_each_2')?['expireddate'])),864000000000)
    int(first(split(dateDifference(items('Apply_to_each_2')?['expireddate'], utcNow()),'.')))

    column: expireddate:

    Sebey_1-1697787332596.png

    the result shows me always false:

    Sebey_2-1697787610619.png

    Kindly assist!

     

  • Verified answer
    v-mengmli-msft Profile Picture
    on at
    Re: Sending email notification 10 days before the expiry date in power automate?

    Hi @Sebey ,

     

    I just modified my expression, please try it:

    div(sub(ticks(utcNow()),ticks(items('Apply_to_each')?['expiredate'])),864000000000)

    The above expression is used to calculate the number of days from 'expiredate' to today.

     

    You can also modify your expression:

    int(first(split(dateDifference(items('Apply_to_each')?['expiredate'], utcNow()),'.')))

     

     

    Best regards,

    Rimmon Li

     

  • Sebey Profile Picture
    127 on at
    Re: Sending email notification 10 days before the expiry date in power automate?

    thanks this works fine, but the condition does not check correctly.  you used the function : "Div"(divided) instead  it should be  current date minus the expired date, then format to check only the day value.

    the above flow sends email  to each user without checking the number of days. I think it needs little amendment.

    I tried to make it:

    int(split(dateDifference(items('Apply_to_each')?['expireddate']), utcNow(), '.')[0])

    but it gives me error.

    can double check it please?

  • v-mengmli-msft Profile Picture
    on at
    Re: Sending email notification 10 days before the expiry date in power automate?

    Hi @Sebey ,

     

    You can create a flow that runs every day, iterates through the records in the list, gets the email address if the expiration date is ten days away from current time, and sends the message.

     

    I did some tests that you can refer to:

    vmengmlimsft_0-1697765181725.png

    The expression in condition:

    div(sub(ticks(items('Apply_to_each')?['expiredate']),ticks(utcNow())),864000000000)

     

     

    Best regards,

    Rimmon Li

  • Michael E. Gernaey Profile Picture
    43,216 Super User 2025 Season 1 on at
    Re: Sending email notification 10 days before the expiry date in power automate?

    Hi @Sebey 

     

    Can you share your flow and what you tried? There are so many examples of doing this over and over. Did you search or just ask for help? Just want to make sure I dont rewrite a flow you already have.

     


    If I have helped you, I would really appreciate if you please Mark my answer as Resolved/Answered, and give it a thumbs up, so it can help others

    Cheers

    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

     

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >