cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dennisb88
Responsive Resident
Responsive Resident

Gallery filter with start and end times

Hi all,

 

I''ve a collection in my app where I've Items that hits all records that have a startdate of today OR have an enddate/time today. That's working fine.

 

Now I want to filter this collection in my gallery as follow:

If start time is between 8.00 and 8.59 it should be showed (works fine)

If end time is 8.00 > it should not showed (Works fine)

If end time is for example 8.30 > it should be showed, this is NOT working.

 

I've the following filter on my gallery:

Filter(Tasks.AllItems,Hour('Startdate (startdate)') = 8 Or Hour('Startdate (startdate)')<=8,Hour('Enddate (enddate)') >8 And Minute('Enddate (enddate)')>1 Or Hour('Startdate (startdate)')<=8,Hour('Enddate (enddate)')>8 ))

 

Anyone an idea how to achieve this?

1 ACCEPTED SOLUTION

Accepted Solutions
dennisb88
Responsive Resident
Responsive Resident

I just figured it out by myself.

The correct filter is:

    Hour('Startdate (Startdate)') = 8 Or Hour('Startdate (Startdate)') <= 8,
    Hour('Enddate (enddate)') > 8 And Minute('Enddate (enddate)') > 1 Or Hour('Startdate (Startdate)') <= 8,
    Hour('Enddate (enddate)') > 8 Or Hour('Startdate (Startdate)') <= 8,
    Hour('Enddate (enddate)') >= 8 And Minute('Enddate (enddate)') >= 1 Or Hour('Startdate (Startdate)') = 8,
    Hour('Enddate (enddate)') >= 8

 

View solution in original post

3 REPLIES 3
PG_WorXz10
Community Champion
Community Champion

Hi @dennisb88 ,

 

Is it because of the extra round bracket in the end. Try below code if it helps in your case. 

Filter(Tasks.AllItems,Hour('Startdate (startdate)') = 8 Or 
        Hour('Startdate (startdate)')<=8,Hour('Enddate (enddate)') >8 And 
		Minute('Enddate (enddate)')>1 Or 
		Hour('Startdate (startdate)')<=8,Hour('Enddate (enddate)')>8 )

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

dennisb88
Responsive Resident
Responsive Resident

Hi @PG_WorXz10 ,

Thank you for your reply.

 

Sorry the bracket was a typo from me.

 

What is not working now, is still the case that I want also show items that start for example at 7.30 end ends at 8.30. That item is not showed up at the moment.

 

I think it's something in my filter, but I don't know how to show it.

 

Does you know how to add that specific part to my formula?

Regards,

Dennis.

dennisb88
Responsive Resident
Responsive Resident

I just figured it out by myself.

The correct filter is:

    Hour('Startdate (Startdate)') = 8 Or Hour('Startdate (Startdate)') <= 8,
    Hour('Enddate (enddate)') > 8 And Minute('Enddate (enddate)') > 1 Or Hour('Startdate (Startdate)') <= 8,
    Hour('Enddate (enddate)') > 8 Or Hour('Startdate (Startdate)') <= 8,
    Hour('Enddate (enddate)') >= 8 And Minute('Enddate (enddate)') >= 1 Or Hour('Startdate (Startdate)') = 8,
    Hour('Enddate (enddate)') >= 8

 

Helpful resources

Announcements
Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

<
Users online (4,410)