cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
AGaudioASG
Level: Powered On

Calendar Gallery to filter Browse Gallery, multiple filters

Building an App for users to sign up for training courses. Right now I have my "Browse Gallery" being filtered by Check boxes and a search box.

 

SortByColumns(
If( 
CheckboxAdmin.Value,Filter('Test: classes',Category.Value="Administrative"),
CheckboxConstruct.Value,  Filter('Test: classes',Category.Value="Construction") ,
CheckboxGen.Value, Filter('Test: classes',Category.Value="General"),
CheckboxSafe.Value, Filter('Test: classes',Category.Value="Safety"),
Search('Test: classes', TextSearchBox1.Text, "Title")),"Date")

 

This is my current filter that works just fine. I want to add the Calender filtering option. 

 

I have a calendar from a gallery:

calendargallery.png

 

Right now my Sharepoint list has the StartDate and EndDate formatted as text. 

 

How would I write the formula to filter the dates, the checkboxes, and the search textbox?  Is there another way to filter a gallery?

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft v-siky-msft
Microsoft

Re: Calendar Gallery to filter Browse Gallery, multiple filters

@AGaudioASG 

 

Is the calendar a component? What is the output property?

I assume the properties are StartDateProperty and EndDateProperty.

Please try this:

SortByColumns(
If(
CheckboxAdmin.Value,Filter('Test: classes',Category.Value="Administrative" && Calendar.StartDateProperty>DateValue(StartDate) && Calendar.EndDateProperty>DateValue(EndDate)),
CheckboxConstruct.Value, Filter('Test: classes',Category.Value="Construction" && Calendar.StartDateProperty>DateValue(StartDate) && Calendar.EndDateProperty>DateValue(EndDate)) ,
CheckboxGen.Value, Filter('Test: classes',Category.Value="General" && Calendar.StartDateProperty>DateValue(StartDate) && Calendar.EndDateProperty>DateValue(EndDate)),
CheckboxSafe.Value, Filter('Test: classes',Category.Value="Safety" && Calendar.StartDateProperty>DateValue(StartDate) && Calendar.EndDateProperty>DateValue(EndDate)),
Search(Filter('Test: classes',Calendar.StartDateProperty>DateValue(StartDate) && Calendar.EndDateProperty>DateValue(EndDate)), TextSearchBox1.Text, "Title")),"Date")

Sik

View solution in original post

2 REPLIES 2
Microsoft v-siky-msft
Microsoft

Re: Calendar Gallery to filter Browse Gallery, multiple filters

@AGaudioASG 

 

Is the calendar a component? What is the output property?

I assume the properties are StartDateProperty and EndDateProperty.

Please try this:

SortByColumns(
If(
CheckboxAdmin.Value,Filter('Test: classes',Category.Value="Administrative" && Calendar.StartDateProperty>DateValue(StartDate) && Calendar.EndDateProperty>DateValue(EndDate)),
CheckboxConstruct.Value, Filter('Test: classes',Category.Value="Construction" && Calendar.StartDateProperty>DateValue(StartDate) && Calendar.EndDateProperty>DateValue(EndDate)) ,
CheckboxGen.Value, Filter('Test: classes',Category.Value="General" && Calendar.StartDateProperty>DateValue(StartDate) && Calendar.EndDateProperty>DateValue(EndDate)),
CheckboxSafe.Value, Filter('Test: classes',Category.Value="Safety" && Calendar.StartDateProperty>DateValue(StartDate) && Calendar.EndDateProperty>DateValue(EndDate)),
Search(Filter('Test: classes',Calendar.StartDateProperty>DateValue(StartDate) && Calendar.EndDateProperty>DateValue(EndDate)), TextSearchBox1.Text, "Title")),"Date")

Sik

View solution in original post

AGaudioASG
Level: Powered On

Re: Calendar Gallery to filter Browse Gallery, multiple filters

@v-siky-msft 

 

Thanks Sik!

 

I did have to tweak your solution to fit my properties but there is a small issue maybe you can help me with. Here is my current formula.

SortByColumns(
If(
CheckboxAdmin.Value,Filter('Test:CourseCatalog',Category.Value="Administrative" && _selectionStart<=StartDate && _selectionEnd>=EndDate),
CheckboxConstruct.Value, Filter('Test:CourseCatalog',Category.Value="Construction" && _selectionStart<=StartDate && _selectionEnd>=EndDate) ,
CheckboxGen.Value, Filter('Test:CourseCatalog',Category.Value="General" && _selectionStart<=StartDate && _selectionEnd>=EndDate),
CheckboxSafe.Value, Filter('Test:CourseCatalog',Category.Value="Safety" && _selectionStart<=StartDate && _selectionEnd>=EndDate),
Search(Filter('Test:CourseCatalog',_selectionStart<=StartDate && _selectionEnd>=EndDate), TextSearchBox1.Text, "Title")),"Date")

 The issue is, now when there are no dates selected, no classes show up. 

 

It should be when no dates are selected (or any other filter) ALL the classes are shown. 

 

Can you help?

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,114)