cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dennisb88
Super User
Super User

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
Super User
Super User

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
Resident Rockstar
Resident Rockstar

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.

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
Super User
Super User

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
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,441)