cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
alex5p
Helper IV
Helper IV

How to filter on the previous year?

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!

1 ACCEPTED SOLUTION

Accepted Solutions

@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

View solution in original post

3 REPLIES 3
rsaikrishna
Dual Super User
Dual Super User

@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.

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?

@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

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,395)