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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,796)