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 / How to filter on the p...
Power Automate
Answered

How to filter on the previous year?

(1) ShareShare
ReportReport
Posted on by 210

How do you get flows to pull from the previous year. I am trying to pull data from our share point using this code. I want to replace the 2019 with a how i did it for 2020 so I wont have to manually go in each year to change it.

 

I believe utcnow only takes 1 pararmeter so not sure what else i can do? 

 

DateOfReferral ge '2019-10-01T00:00:00.0000000Z' and DateOfReferral le '@{utcNow('yyyy')}-09-01T00:00:00.0000000Z'

 

Any help is appreciated!

Categories:
  • rsaikrishna Profile Picture
    3,703 on at

    @alex5p 

     

    Try using formatDateTime(utcNow(),'yyyy')  express. This will give you current year based on today's date.

     

    Regards

    Krishna Rachakonda

    If my reply help resolving your issue, please mark it as Accepted Solution.

  • alex5p Profile Picture
    210 on at

    Hi @rsaikrishna 

     

    Wouldn't that give me the current year based on todays date? So if i run it today it would show 2020. How would I get it to show 2019. Make it go back a year?

  • Verified answer
    rsaikrishna Profile Picture
    3,703 on at

    @alex5p 

     

    You can use following expression for previous year:

    Add(int(formatDateTime(utcNow(),'yyyy')),-1)

     

    Please give a try and let me know if you run into any issues.

     

    Regards

    Krishna Rachakonda

    If the above reply helps resolving the issue, please mark the issue as Accepted Solution

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 227 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 213 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 151

Last 30 days Overall leaderboard