Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Filter gallery by multiple dropdowns and textinput

(0) ShareShare
ReportReport
Posted on 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
    Matt383 395 on at
    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
    WarrenBelz 145,343 on at
    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
    Matt383 395 on at
    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
    Matt383 395 on at
    Re: Filter gallery by multiple dropdowns and textinput

    Thanks WarrenBelz

  • Verified answer
    WarrenBelz Profile Picture
    WarrenBelz 145,343 on at
    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

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