cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Get Items based on Time in Microsoft Flow

Hi All,

 

I have a flow which retrives items from the sharepoint list based on date in the filter query. However I want to change to filter items between 3PM to 11:59PM only. I'm not sure how do I achieve this. Any help is appreciated.

 

Thanks.

 

Capture.PNG

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bacao-msft
Community Support
Community Support

Hi @Anonymous,

 

If you want to use "time" as a filter for getting items, the specified field needs to contain time.

You could first format the date to "HH:mm" style using the formatDatetime() function.

Then use Filter array to filter the output of Get items.

Expression reference:

@and(greaterOrEquals(addHours(item()['Date'], -8, 'HH:mm'), '15:00'),lessOrEquals(addHours(item()['Date'], -8, 'HH:mm'), '23:59'))

Image reference:

3.PNG

Please take a try.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-bacao-msft
Community Support
Community Support

Hi @Anonymous,

 

If you want to use "time" as a filter for getting items, the specified field needs to contain time.

You could first format the date to "HH:mm" style using the formatDatetime() function.

Then use Filter array to filter the output of Get items.

Expression reference:

@and(greaterOrEquals(addHours(item()['Date'], -8, 'HH:mm'), '15:00'),lessOrEquals(addHours(item()['Date'], -8, 'HH:mm'), '23:59'))

Image reference:

3.PNG

Please take a try.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Anonymous
Not applicable

Thank You. I'll try this solution now.

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!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (2,594)