cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sesese
Helper III
Helper III

Filter gallery by multiple dropdown & textinput

Hey guys, 

 

I would like to filter my gallery with 2 dropdowns & 1 textinput:

 

Dropdown 1: Items: "Waiting for approval", "Approved". The formula to filter the gallery only with this dropdown is: "If(Dropdown1.Selected.Value="Waiting for approval";Filter(colrequests;And('Approval status 1'="Waiting for approval";'Approval status 2'="Approved"));Filter(colrequests;Or('Approval status 1'="Rejected";'Approval status 1="Approved")))

 

Dropdown 2: Items are from a Distinct formula on the Client Sharepoint List. The formula to filter the gallery only with this dropdown is: Filter(colrequests;Client=Dropdown2.Selected.Value).

 

TextInput 1: Default is blank. If i type the request number hree the formula must be Filter(colrequests;StartsWith(Title;TextInput1.Text)

 

How can I merge them?

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Sesese ,

You just need to add that one the same way

With(
   {
      wApproved:
      Dropdown1.Selected.Value = "Waiting for approval"
   },
   Filter(
      colrequests;
      (
         (
            wApproved &&   
            'Approval status 1' = Dropdown1.Selected.Value &&
            'Approval status 2' = "Approved"
         ) ||
         (
            !wApproved &&
            (
               'Approval status 1'="Rejected" ||
               'Approval status 1="Approved"
            )
         )      
      ) &&
      (
         Len(TextInput1.Text) = 0 ||
         StartsWith(
            Title;
            TextInput1.Text
      ) &&
      (
         Len(Dropdown2.Selected.Value) = 0 ||
         Client = Dropdown2.Selected.Value
      )
   )
)

 

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.

Visit my blog Practical Power Apps

View solution in original post

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @Sesese ,

Try this format - a lot of bracketing required to separate and/or

With(
   {
      wApproved:
      Dropdown1.Selected.Value = "Waiting for approval"
   },
   Filter(
      colrequests;
      (
         (
            wApproved &&   
            'Approval status 1' = Dropdown1.Selected.Value &&
            'Approval status 2' = "Approved"
         ) ||
         (
            !wApproved &&
            (
               'Approval status 1'="Rejected" ||
               'Approval status 1="Approved"
            )
         )      
      ) &&
      (
         Len(TextInput1.Text) = 0 ||
         StartsWith(
            Title;
            TextInput1.Text
      )
   )
)

 

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.

Visit my blog Practical Power Apps

Hi @WarrenBelz,

 

thanks for your answer.

I think in this formula I only filter the gallery according to Dropdown 1 and Textinput1, Dropdown 2 seems missing

Hi @Sesese ,

You just need to add that one the same way

With(
   {
      wApproved:
      Dropdown1.Selected.Value = "Waiting for approval"
   },
   Filter(
      colrequests;
      (
         (
            wApproved &&   
            'Approval status 1' = Dropdown1.Selected.Value &&
            'Approval status 2' = "Approved"
         ) ||
         (
            !wApproved &&
            (
               'Approval status 1'="Rejected" ||
               'Approval status 1="Approved"
            )
         )      
      ) &&
      (
         Len(TextInput1.Text) = 0 ||
         StartsWith(
            Title;
            TextInput1.Text
      ) &&
      (
         Len(Dropdown2.Selected.Value) = 0 ||
         Client = Dropdown2.Selected.Value
      )
   )
)

 

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.

Visit my blog Practical Power Apps

WarrenBelz
Super User
Super User

Hi @Sesese ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

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.

Visit my blog Practical Power Apps

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,735)