cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

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
Highlighted

@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
Highlighted
Super User II
Super User II

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

Highlighted

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?

Highlighted

@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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Kudoed Authors
Users online (9,870)