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

Filter Gallery by Calendar date range

Calendar.jpg

 

I have a calendar and a gallery on a screen in my PowerApp. The client would to be able to filter the gallery by using the date range that's in red and blue. Any suggestions?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Filter Gallery by Calendar date range

@Anonymous 

Ok, if it's a SharePoint list then your calendar list will have a column defined - Start Time  (which is really EventDate behind the scenes)

So your Filter would be:

  Filter(yourDataSource, 'Start Time' >= _selectionStart && 'Start Time' <= _selectionEnd)

 

If you have issues with the 'Start Time' not showing up, try the EventDate.

 

Hope that helps you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
9 REPLIES 9
Super User
Super User

Re: Filter Gallery by Calendar date range

@Anonymous 

What problem are you running into?

I assume you are using the GetEventsCalendarViewV2 of the Office365 Outlook connector.  If so, you can specify the start and end dates on that formula.

 

I hope that helps shed some light for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Anonymous
Not applicable

Re: Filter Gallery by Calendar date range

@RandyHayes Hi Randy, I'm just not certain as to what formula I need to use for my gallery to filter it by the date range. I'm using a SharePoint calendar as my datasource. I'm not using the O365 Connector.

Super User
Super User

Re: Filter Gallery by Calendar date range

@Anonymous 

Ok, if it's a SharePoint list then your calendar list will have a column defined - Start Time  (which is really EventDate behind the scenes)

So your Filter would be:

  Filter(yourDataSource, 'Start Time' >= _selectionStart && 'Start Time' <= _selectionEnd)

 

If you have issues with the 'Start Time' not showing up, try the EventDate.

 

Hope that helps you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Community Support Team
Community Support Team

Re: Filter Gallery by Calendar date range

Hi @Anonymous ,

Do you want to filter your Gallery items (use SP Calendar list as data source) based on the Date range you selected from your Calendar?

 

I have made a test on my side, please take a try with the following workaround:

Set the Items property of the Gallery to following:

Filter(
        'YourCalendarList',
         'Start Time' >= _selectionStart,
         'End Time' <= _selectionEnd
)

Or

Filter(
        'YourCalendarList',
         Value(Text('Start Time', "[$-en-US]yyyymmdd")) >= Value(Text(_selectionStart, "[$-en-US]yyyymmdd")),
         Value(Text('End Time',"[$-en-US]yyyymmdd")) <= Value(Text(_selectionEnd, "[$-en-US]yyyymmdd"))
)

Please take a try with above solution, then check if the issue is solved.

 

More details about Filter function in PowerApps, please check the following article:

Filter function

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Anonymous
Not applicable

Re: Filter Gallery by Calendar date range

@RandyHayes Worked perfectly. Thanks!!

AndiRodi
Level: Powered On

Re: Filter Gallery by Calendar date range

but this way you don't have problems with the delegation?

Super User
Super User

Re: Filter Gallery by Calendar date range

@AndiRodi 

Oh most definitely you would have problems with delegation with that formula.  That was not an original concern in this post.

If you are experiencing that problem and need some help, I would suggest starting a new post with that issue.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
AndiRodi
Level: Powered On

Re: Filter Gallery by Calendar date range

hi @RandyHayes 

 

Thnaks for your anware.

 

I have a big problem with Date Picker.

 

I have a Gallery which i filter by a selctede Date from DatePicker controll. This is the cod that i seet to Items Propriety of gallery controll

items=SortByColumns(Search(Filter(Appointments;DateValue(Text('Start Time')) = DateValue(Text(datepFilterDatePicker.SelectedDate)));TextSearchBox1.Text;"subject");"scheduledstart";If(SortDescending1;Descending;Ascending))//Filter(Appointments,DateValue(Text(Date)) = DateValue(Text(datepFilterDatePicker.SelectedDate)))

The Text() function is stopping the delegation. Then i try to do as below

SortByColumns(Search(Filter(Appointments;'Start Time'>datepFilterDatePicker.SelectedDate&&'Start Time'<DateAdd(datepFilterDatePicker.SelectedDate;1;Days));TextSearchBox1.Text;"subject");"scheduledstart";If(SortDescending1;Descending;Ascending))

but knnow i geth this error.MicrosoftTeams-image.png

Please Let me know as soon as hao i can do a workaround.

 

Thanks

 

Andi

Super User
Super User

Re: Filter Gallery by Calendar date range

@AndiRodi 

This would be better done through a new post rather than adding on to this post which is already solved.

 

But, since we're here - 

Change your Gallery Items Property to:

SortByColumns(
Search(
Filter(Appointments;
('Start Time' >= datepFilterDatePicker.SelectedDate)
&& ('Start Time' <= DateAdd(datepFilterDatePicker.SelectedDate;1;Days))
);
TextSearchBox1.Text; "subject"
);
"scheduledstart";
If(SortDescending1;Descending;Ascending)
)

If that doesn't immediately help, I would start a new post on this forum with the results you are seeing.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 55 members 4,855 guests
Please welcome our newest community members: