Skip to main content

Notifications

Community site session details

Community site session details

Session Id : xrh758ppMZNTI11t1dRz/5
Power Apps - Building Power Apps
Answered

I can filter and search text and date but adding ComboBox breaks the gallery

Like (0) ShareShare
ReportReport
Posted on 21 Sep 2022 15:02:09 by 18

I am using a gallery to show data. I can use these two codes separate and the gallery works. 

 

Search(Filter(SortByColumns('Production Reporting',"Created"),Created>=DatePickerStart.SelectedDate, Created<=DatePickerEnd.SelectedDate),InputEmployee.Text,"Employee","Employee2","Employee3","PartNumber")


Filter('Production Reporting','Work Center'.Value = ComboBox1.Selected.Value)

 


However when I combine them, the Gallery comes up empty (as seen below):

 

Search(Filter(Filter(SortByColumns('Production Reporting',"Created"),Created>=DatePickerStart.SelectedDate, Created<=DatePickerEnd.SelectedDate),'Work Center'.Value = ComboBox1.Selected.Value),InputEmployee.Text,"Employee","Employee2","Employee3","PartNumber")

 

Any help would be appreciated! 
gallery broke.png

  • ingallspw Profile Picture
    18 on 21 Sep 2022 at 17:27:11
    Re: I can filter and search text and date but adding ComboBox breaks the gallery

    Nevermind... I had duplicated the form and changed the datepicker name but not the formula. The "Or" || statment worked! 

  • ingallspw Profile Picture
    18 on 21 Sep 2022 at 17:11:11
    Re: I can filter and search text and date but adding ComboBox breaks the gallery

    Thanks!! I tried this but sorry to say it fails. Then I just added the || or statement and it works better but only pulls up the second item on the list when nothing is selected? 

     

    I see you combined the filter function... I couldn't get that to work the first time and that's why I had it twice. 

    (By the way... I subbed to your YouTube channel!)

  • Verified answer
    RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on 21 Sep 2022 at 15:06:05
    Re: I can filter and search text and date but adding ComboBox breaks the gallery

    @ingallspw 

    Please consider changing your Formula to the following:

    SortByColumns('Production Reporting'
     Search(
     Filter(
     Created>=DatePickerStart.SelectedDate, 
     Created<=DatePickerEnd.SelectedDate,
     'Work Center'.Value = ComboBox1.Selected.Value || IsBlank(ComboBox1.Selected.Value)
     ),
     InputEmployee.Text,"Employee", "Employee2","Employee3","PartNumber"
     ),
     "Created"
    )

     

    I hope this is helpful for you.

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,745 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard
Loading started