cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

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

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

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

Highlighted
Helper II
Helper II

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
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,716)