Forum Discussion

gavinpaz's avatar
gavinpaz
Copper Contributor
Jan 31, 2023
Solved

Power Automate flow that is triggered by the difference between today and an employees start date.

Hi everyone! I am trying to make a flow in power automate that when 30,60, and 90 days have passed since an employees start date it will send someone an email. The start date is a column in a sharepoint list. I already have it set up to access the list and get the item 'Start Date'. I cannot figure out a way to get it to check the difference between todays date and the start date, and if it is 30 days to trigger the flow. I have tried using ChatGPT and other posts but none of the solutions I've found there have seemed to work, the expressions are always invalid. Any help would be great, if more details are needed let me know. 

 

Thanks, 

Gavin. 

  • Hi gavinpaz ,

     

    you should create a scheduled flow that runs every day

     

    1) If your StartDate column does not have a time value:

    Then create a variable with the name "In30Days" of type String and use this expression

     

    convertToUtc(startOfDay(addDays(convertTimeZone(utcNow(),'UTC','W. Europe Standard Time'),30)),'W. Europe Standard Time')

     

    Create a "Get Items" from SharePoint Query and query for all the list items with the following filter query

     

    StartDate eq datetime'@{variables('In30Days')}' 

     

     
    2) If your StartDate column has a time value:
    Create two variables, one for the date in 30 days and one for the date in 29 days and filter for this

     

    StartDate le datetime'@{variables('In30Days')}' and StartDate gt datetime'@{variables('In29Days')}' ​


    Best Regards,
    Sven

     

     

  • SvenSieverding's avatar
    SvenSieverding
    Bronze Contributor

    Hi gavinpaz ,

     

    you should create a scheduled flow that runs every day

     

    1) If your StartDate column does not have a time value:

    Then create a variable with the name "In30Days" of type String and use this expression

     

    convertToUtc(startOfDay(addDays(convertTimeZone(utcNow(),'UTC','W. Europe Standard Time'),30)),'W. Europe Standard Time')

     

    Create a "Get Items" from SharePoint Query and query for all the list items with the following filter query

     

    StartDate eq datetime'@{variables('In30Days')}' 

     

     
    2) If your StartDate column has a time value:
    Create two variables, one for the date in 30 days and one for the date in 29 days and filter for this

     

    StartDate le datetime'@{variables('In30Days')}' and StartDate gt datetime'@{variables('In29Days')}' ​


    Best Regards,
    Sven

     

     

Resources