Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Calendar Gallery to filter Browse Gallery, multiple filters

(0) ShareShare
ReportReport
Posted on by

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?

  • 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?

  • Verified answer
    v-siky-msft Profile Picture
    v-siky-msft on at
    Re: Calendar Gallery to filter Browse Gallery, multiple filters

    @Anonymous 

     

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,343

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,703

Leaderboard