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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Run an action a set nu...
Power Automate
Answered

Run an action a set number of days after a specific date taken from a Sharepoint list value?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

 

I'm currently trying to set Flow up to send an email only if the current date is a set number of days after a date which is taken from a Sharepoint list, ie. users input data into a Sharepoint list with an employee start date in one of the columns and a reminder email is sent if X number of days has passed since start date.

 

I'm trying to set up the condition to check if the current date is 150 days from the date specified in the Sharepoint list, but clearly what I have at the moment isn't right. Does anyone have any ideas?

 

 

Thanks,

 

John

Categories:
I have the same question (0)
  • v-yamao-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

     

    According to your description, I created a flow likes below for your reference.

     

    The flow is triggered by a Button, getting items from a list. In the list, there is column Date. Then adding a Condition to check if current date is 30 days from the date specified in the list.

     

    In advanced mode, enter the following code:

    @equals(formatDateTime(utcnow(), 'yyyy-MM-dd'), formatDateTime(addDays(items('Apply_to_each')?['Date'], 30), 'yyyy-MM-dd'))

     

    You could also try to enter the code in basic mode. Be sure to enter the code under the Expression tab likes below.

     

    Then when the button is clicked, items that meet the condition will be sent out from flow.

    1.PNG2.PNG

     

    Please take a try with it on your side.

     

     

    Best regards,

    Mabel Mao

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hey @v-yamao-msft,

     

    Thank you so much for having a look.

     

    I've entered your code and changed it to fit my inputs as follows:

     

     

    @equals(formatDateTime(utcnow(), 'yyyy-MM-dd'), formatDateTime(addDays(items('Apply_to_each')?['StartDate'], 150), 'yyyy-MM-dd'))

     

    I tried running this but the flow failed, but noticed you have the "Compose" action before the Condition check, so I added it to mine too as follows:

     

    Capture4.PNG

     

    I'm not certain what I need in the "Compose" action, so I tried using the same code and running but produces the following error:

     

    Capture3.PNG

     

    Do you know what I should be adding to the Compose action for this to work?

     

    Thank you Smiley Very Happy

     

     

     

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I've managed to fix this using a slightly different method - as I actually needed two different values I've done the date difference calculation on the Sharepoint list instead of the inside the Flow using the following code:

     

     

    =IF([Perm/TTP]="Perm",DATE(YEAR(StartDate),MONTH(StartDate)+5,DAY(StartDate)),DATE(YEAR(StartDate),MONTH(StartDate)+8,DAY(StartDate)))

    This checks if the value in the "Perm/TTP" column and outputs either "StartDate + 5 months" or "StartDate + 8 months" based on this.

     

     

     

    Capture.PNG

     

    Then compared the date values within Flow using the following:

     

    @equals(formatDateTime(utcnow(), 'yyyy-MM-dd'), body('Convert_time_zone'))

    Capture2.PNG

     

    I've added the "Convert time zone" action because I noticed the comparison was returning false when I was expecting it to return true. After checking the values using compare (I now know what this is useful for Smiley Happy) I found that the timezones Flow and Sharepoint were using didn't match.

     

    So this now works Smiley Happy

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 241 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 179

#3
Haque Profile Picture

Haque 159

Last 30 days Overall leaderboard