cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bobbybob
Helper II
Helper II

Filter one gallery based on another gallery selection

I've been trying to figure out how to accomplish this but unable to do so. Any help or advise would be appreciated.

 

I have a gallery setup to filter based on a column of groups. I would like to have a second gallery linked to the first so when the user selects a group it shows all the items under that group category. 

This is the formula for my first gallery:
Distinct('Calling Tree', ID)

I would like the user to be able to select an item from the first gallery that opens the second gallery list showing only items listed from the group ID they selected. I would also like to add to the formula above to allow the user to search the "ID' in a search box. 

The second gallery has this formula already in place to filter:

If(!IsBlank(TextSearchBox1.Text),Filter('Calling Tree', TextSearchBox1.Text in Tool || TextSearchBox1.Text in URL),'Calling Tree')

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @bobbybob ,

I am assuming a field name here, but the structure would be

Filter(
   'Calling Tree', 
   (
      Len(TextSearchBox1.Text) = 0 ||
      TextSearchBox1.Text in Tool || 
      TextSearchBox1.Text in URL
   ) && 
   ID = Gallery1.Selected.Result
)

however I am a little confused about the searching of the ID - if you want the one selected in the gallery, then the ID will be the same for all items in the second gallery. I also assume this is not the SharePoint ID.

 

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

3 REPLIES 3
WarrenBelz
Super User
Super User

Hi @bobbybob ,

I am assuming a field name here, but the structure would be

Filter(
   'Calling Tree', 
   (
      Len(TextSearchBox1.Text) = 0 ||
      TextSearchBox1.Text in Tool || 
      TextSearchBox1.Text in URL
   ) && 
   ID = Gallery1.Selected.Result
)

however I am a little confused about the searching of the ID - if you want the one selected in the gallery, then the ID will be the same for all items in the second gallery. I also assume this is not the SharePoint ID.

 

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 
Thank you! It works. I've been trying to figure this out for days and your formula worked perfectly. Thank you.

For my first Gallery I have only the group ID's listed and no they are not SharePointID's. I wanted the user to be able to search for an ID in the first Gallery and be able to search for "Tool" or "URL" in the second Gallery. It's a lot a data to go through so having a search option for the user makes things a little easier. 

If you have a way to add a search function to both Gallery formulas then I would greatly appreciate the answer. Thank you again for your help.

@bobbybob ,

To keep it Delegable

With(
   {
      wList:
      Filter(
         'Calling Tree', 
         (
            Len(TextSearchBox1.Text) = 0 ||
            TextSearchBox1.Text in Tool || 
            TextSearchBox1.Text in URL
         ) && 
         ID = Gallery1.Selected.Result
      )
   },
   Search)
      wList,
      YourTextBoxName.Text,
      "YourFieldSearched"
   )
)

 

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 (3,514)