cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

how to use a two way filter on a gallery

Up at the top it has 4 icons (Top Search Section) that represent columns displayed in the gallery below ( Icon.Person ="Full Name", Icon.Mail="Email", Icon.OfficeBuilding= "Company", Icon.People="Group"). When a user chooses an icon, it sets which field the search box searches below.

2019-08-26 15_06_28-RD Contacts - Saved (Unpublished) - PowerApps.png

 

Icon Formula:

Icon.Person= On Select: Set(VarSearch,"Full Name")

Icon.Mail= On Select: Set(VarSearch,"Email")

Icon.OfficeBuilding=On Select: Set(VarSearch,"Company")

Icon.People= On Select: Set(VarSearch,"Group")

 

When Icon.People is shown the text box is replaced with a combo box of all the possible groups pulled from a SharePoint Choice column.

 

Search TextBox:

Visible: If(SearchGallery1_1.Selected.Value="FullN",true,SearchGallery1_1.Selected.Value="Company",true,SearchGallery1_1.Selected.Value="Email",true)

 

Search ComboBox:

Items: Choices ('Contact List'.Profession)

Visible: If(VarSearch="Profession",true,false)

 

Gallery 1:

Items: Switch(VarSearch,"Full Name",Filter(LocalContacts,StartsWith('Full Name',TextSearchBox1_2.Text)),"Email", Filter(LocalContacts,StartsWith('Email Address',TextSearchBox1_2.Text)),"Company", Filter(LocalContacts,StartsWith(Company,TextSearchBox1_2.Text)),Blank(),Filter(LocalContacts,ID>0))

 

**Missing Cannot Search Group** Cannot figure out how to add the "Group" choice column to the search switch value.

 

I also have a side slider (Side Search Section) that only shows when "Full Name" is selected and sorts the gallery by first letter of first name.  

 

2019-08-26 14_53_29-RD Contacts - Saved (Unpublished) - PowerApps.pngSlider:

Max =26

Min=0

Show Value =false

 

Lablel above Slider:

Text: Switch(Slider1.Value,26,"ALL",25,"A",24,"B",23,"C",22,"D",21,"E",20,"F",19,"G",18,"H",17,"I",16,"J",15,"K",14,"L",13,"M",12,"N",11,"O",10,"P",9,"Q",8,"R",7,"S",6,"T",5,"U",4,"V",3,"W",2,"X",1,"Y",0,"Z")

Visible: If(VarSearch="Full Name",true,false)

 

Gallery 2:

Items: If(LbSearchLetter.Text="ALL",LocalContacts,Filter(LocalContacts,StartsWith('Full Name',LbSearchLetter.Text)))

 

Currently I cannot get these working on the same page.  Any ideas on how I can combine or manipulate Gallery 1 & 2 formulas to work together on 1 gallery?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: how to use a two way filter on a gallery

Hi @mandy4514 ,

Do you want to filter your Gallery Items based on the Top Search Section and Side Slider control?

 

I have made a test on my side, please take a try with the following workaround:

Set the Items property of the Gallery to following:

 

Filter(
         LocalContacts,
If(
VarSearch = "Full Name",
StartsWith('Full Name', TextSearchBox1_2.Text) && StartsWith('Full Name', LbSearchLetter.Text),
VarSearch = "Email",
StartsWith('Email Address', TextSearchBox1_2.Text),
VarSearch = "Company",
StartsWith(Company, TextSearchBox1_2.Text),
VarSearch = Blank(),
ID > 0
) )

Or

Filter(
         LocalContacts,
         If(
            VarSearch = "Full Name",
            StartsWith('Full Name', TextSearchBox1_2.Text) && StartsWith('Full Name', LbSearchLetter.Text),
            VarSearch = "Email",
            StartsWith('Email Address', TextSearchBox1_2.Text),
            VarSearch = "Company",
            StartsWith(Company, TextSearchBox1_2.Text),
            IsBlank(VarSearch),
            ID > 0
         )
)

Please take a try with above solution, check if the issue is solved.

 

Best regards,

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Highlighted
Community Support
Community Support

Re: how to use a two way filter on a gallery

Hi @mandy4514 ,

Do you want to filter your Gallery Items based on the Top Search Section and Side Slider control?

 

I have made a test on my side, please take a try with the following workaround:

Set the Items property of the Gallery to following:

 

Filter(
         LocalContacts,
If(
VarSearch = "Full Name",
StartsWith('Full Name', TextSearchBox1_2.Text) && StartsWith('Full Name', LbSearchLetter.Text),
VarSearch = "Email",
StartsWith('Email Address', TextSearchBox1_2.Text),
VarSearch = "Company",
StartsWith(Company, TextSearchBox1_2.Text),
VarSearch = Blank(),
ID > 0
) )

Or

Filter(
         LocalContacts,
         If(
            VarSearch = "Full Name",
            StartsWith('Full Name', TextSearchBox1_2.Text) && StartsWith('Full Name', LbSearchLetter.Text),
            VarSearch = "Email",
            StartsWith('Email Address', TextSearchBox1_2.Text),
            VarSearch = "Company",
            StartsWith(Company, TextSearchBox1_2.Text),
            IsBlank(VarSearch),
            ID > 0
         )
)

Please take a try with above solution, check if the issue is solved.

 

Best regards,

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (4,741)