Skip to main content

Notifications

Community site session details

Community site session details

Session Id : pD9JnDxKQfolnc1kD4XMVQ
Power Apps - Building Power Apps
Answered

Filter gallery by multiple dropdowns and textinput

Like (0) ShareShare
ReportReport
Posted on 1 May 2023 23:05:05 by 395

Hi, I have a gallery with a collection as the datasource. I have 2 dropdowns and a textinput. The ArrngDrop dropdown and DocDrop1 dropdown only filter if both dropdowns have a selection, however only the ArrngDrop filters. I just wanted to be able to have the ability to for the user to filter with either one or both dropdowns, as well as the textinput (ArrngSrch.Text).  Any advice would be much appreciated.

 

(Sort(Filter(ProcedureCollect,Arrangement = Label90.Text && Engine = Label91.Text, Len(ArrngDrop.Selected.Value)= 0 Or Len(DocDrop1.Selected.Value)=0 || ComponentType = ArrngDrop.Selected.Value || DocDrop1.Selected.Value
, Or(StartsWith(ComponentType, ArrngSrch.Text))),Sequence,SortOrder.Ascending))

Categories:
  • Matt383 Profile Picture
    395 on 02 May 2023 at 23:39:05
    Re: Filter gallery by multiple dropdowns and textinput

    Thanks WarrenBelz, i did try Or, but diddnt have the bracket in front of Startswith. Cheers

  • Verified answer
    WarrenBelz Profile Picture
    146,508 Most Valuable Professional on 02 May 2023 at 23:30:20
    Re: Filter gallery by multiple dropdowns and textinput

    Hi @Matt383 ,

    Needs Or not And as well as some bracketing

    Sort(
     Filter(
     ProcedureCollect,
     Arrangement = Label90.Text &&
     Engine = Label91.Text &&
     (
     Len(ArrngDrop.Selected.Value)= 0 ||
     ComponentType = ArrngDrop.Selected.Value
     ) &&
     (
     Len(DocDrop1.Selected.Value)=0 ||
     DocumentType = DocDrop1.Selected.Value
     ) &&
     (
     StartsWith(
     ComponentType,
     ArrngSrch.Text
     ) ||
     StartsWith(
     PN_Arrangement,
     ArrngSrch.Text
     )
     ),
     Sequence,
     SortOrder.Ascending
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • Matt383 Profile Picture
    395 on 02 May 2023 at 22:56:29
    Re: Filter gallery by multiple dropdowns and textinput

    Hi WarrenBelz,

     

    Just in regards to having the textinput search,  to search from 2 different columns (e.g. ComponentType and PN_Arrangement . I have tried a few different variations but with no luck. I thought i would be just able to use Startswith(ComponentType,ArrngSrch.Text),Startswith(PN_Arrangement,ArrngSrch.Text), howerver the dropdowns work as they should but no response from the text search.  Same outcome with below 

     

    Sort(
    Filter(
    ProcedureCollect,
    Arrangement = Label90.Text &&
    Engine = Label91.Text &&
    (
    Len(ArrngDrop.Selected.Value)= 0 ||
    ComponentType = ArrngDrop.Selected.Value
    ) &&
    (
    Len(DocDrop1.Selected.Value)=0 ||
    DocumentType = DocDrop1.Selected.Value
    ) &&
    StartsWith(
    ComponentType,
    ArrngSrch.Text
    ) &&
    StartsWith(
    PN_Arrangement,
    ArrngSrch.Text
    )

    ),
    Sequence,SortOrder.Ascending
    )

  • Matt383 Profile Picture
    395 on 02 May 2023 at 00:01:05
    Re: Filter gallery by multiple dropdowns and textinput

    Thanks WarrenBelz

  • Verified answer
    WarrenBelz Profile Picture
    146,508 Most Valuable Professional on 01 May 2023 at 23:54:16
    Re: Filter gallery by multiple dropdowns and textinput

    Hi @Matt383 ,

    You are missing the field that DcoDrop1 needs to filter - you also need some proper bracketing between And/Or arguments

    Sort(
     Filter(
     ProcedureCollect,
     Arrangement = Label90.Text && 
     Engine = Label91.Text &&
     (
     Len(ArrngDrop.Selected.Value)= 0 ||
     ComponentType = ArrngDrop.Selected.Value
     ) &&
     (
     Len(DocDrop1.Selected.Value)=0 || 
     YourFieldHere = DocDrop1.Selected.Value
     ) &&
     StartsWith(
     ComponentType, 
     ArrngSrch.Text
     )
     ),
     Sequence
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

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

Thomas Rice – Community Spotlight

We are honored to recognize Thomas Rice as our March 2025 Community…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community

Announcing Our 2025 Season 1 Super Users!

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

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,508 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,369 Most Valuable Professional

Leaderboard
Loading started
Loading complete