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
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (53,759)