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 Automate
Unanswered

Get date minus day

(0) ShareShare
ReportReport
Posted on by

Hello,

 

I have a SharePoint list with column Date and Time and i want a flow that should be run depends on "Date &Time" minus 7 days.

example : if "Date and Time" equals to 12/01/2020 9h AM, the result should be : 05/02/2020 9h AM.

 

Any ideas?

Categories:
I have the same question (0)
  • sudharsan1985 Profile Picture
    1,325 on at

    Hi @Anonymous 

    You can add a condition to the flow to check for items that meet the below condition and then execute the business logic.

    DateField eq formatDateTime(addDays(utcNow(), -7), 'yyyy-MM-dd')

     The above condition can be used to get the items whose DateTime field value is equal to current date - 7 days.

     

  • Community Power Platform Member Profile Picture
    on at

    hello @sudharsan1985 ,

     

    Can you tell me what's the error please?

     

    the condition is : Date_x0020_et_x0020_heure_x0020_ eq formatDateTime(addDays(utcNow(), -7), 'dd-MM-yyyy')

     

    error trigger.PNG

  • VictorIvanidze Profile Picture
    13,073 on at

    What is Date_x0020_et_x0020_heure_x0020_? A variable? If so, what is its value?

  • Community Power Platform Member Profile Picture
    on at

    hello @VictorIvanidze 

     

    Date_x0020_et_x0020_heure_x0020_ : it's the column name type Date and time

  • VictorIvanidze Profile Picture
    13,073 on at

    And what does it contain?

  • Community Power Platform Member Profile Picture
    on at

    Date and time, when the user choose the date and time and save it to SharePoint list, i want flow to get the date minus 7 days and continue the steps

     

    DT.PNG

  • VictorIvanidze Profile Picture
    13,073 on at
  • sudharsan1985 Profile Picture
    1,325 on at

    HI @Anonymous 

    I provided the condition to be used inside an action like Get Items etc. If you want to use it in triggerActions, please have a look at the following links

    Microsoft Power Automate Flow Trigger Conditions

    Power Automate Trigger Conditions made EASY

     

     

  • Community Power Platform Member Profile Picture
    on at

    Hello @sudharsan1985 ,

     

    I tried the get items and a condition inside

     

    get items.PNG

     

    In condition : equals(outputs('Obtenir_les_éléments')?['body/value'], formatDateTime(addDays(utcNow(), -7, 'yyyy-MM-dd')))

     

    but it's not working, any ideas ?

     

    SharePoint column is Date & Time

    date & time.PNG

  • sudharsan1985 Profile Picture
    1,325 on at

    Hi @Anonymous 

    I think you misunderstood, the condition code that I mentioned is to use as a Filter Query inside the Get Items action. The condition you had mentioned should come in the triggerCondition and not the value for the Condition branch. I think you are confused, just try the condition code that I replied in the Filter Query. It should work.

     

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 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard