cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
mandy4514
Level: Powered On

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
Community Support Team
Community Support Team

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.
1 REPLY 1
Community Support Team
Community Support Team

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.

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 186 members 5,515 guests
Please welcome our newest community members: