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
Community Support
Community Support

Re: Get Items based on Time in Microsoft Flow

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
Community Support
Community Support

Re: Get Items based on Time in Microsoft Flow

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

Highlighted
Anonymous
Not applicable

Re: Get Items based on Time in Microsoft Flow

Thank You. I'll try this solution now.

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,447)