cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sajarac
Kudo Kingpin
Kudo Kingpin

Filter Gallery Items

Hi there.

 

Quick question here?

 

I currently have my gallery and is working fine. As you can see I can filter my gallery based in my dropdowns selection or my Radio1 selection.

 

Now As a default I have my Radio1 "Condo" so my gallery always is filtered with that condition.

 

I would like to have my gallery to show all of the items "Condo", House", "Comm". I I would like to filter my gallery if I select a City, a State and now a type.

 

but I could find the way to change my current formula.

 

Could someone please point me in the right direction?

 

 

sajarac_0-1621440519144.png

 

 

Search(    Filter(        Market,         (CboState.Selected.Result = Blank() || State = CboState.Selected.Result) && (CboCity.Selected.Result = Blank() || City = CboCity.Selected.Result)&& (CboZipCode.Selected.Result = Blank())),    (Type = Radio1.Selected.Value)),TextSearchBox1.Text,"Name")

 

 

Thanks in advance

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @sajarac ,

Where is the error referring to - I was simply using the values you posted as I cannot see your data. If it is zipcode, you need

Search(
   Filter(
      Market, 
      (
         Len(CboState.Selected.Result) = 0 || 
         State= CboState.Selected.Result
      ) && 
      (
         Len(CboCity.Selected.Result) = 0 || 
         City = CboCity.Selected.Result
      ) &&
      (
         Len(CboZipCode.Selected.Result) = 0 ||
         ZipCode = Value(CboZipCode.Selected.Result)
      ) &&
      Type = Radiol.Selected.Value
   ),
   TextSearchBoxl.Text,
   "Name"
)

 

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.

View solution in original post

8 REPLIES 8
WarrenBelz
Super User
Super User

Hi @sajarac ,

Try this

Search(
   Filter(
      Market, 
      (
         Len(CboState.Selected.Result) = 0 || 
         State= CboState.Selected.Result
      ) && 
      (
         Len(CboCity.Selected.Result) = 0 || 
         City = CboCity.Selected.Result
      ) &&
      (
         Len(CboZipCode.Selected.Result) = 0 ||
         ZipCode = CboZipCode.Selected.Result
      ) &&
	  Type = Radiol.Selected.Value
   ),
   TextSearchBoxl.Text,
   "Name"
)

 

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.

sajarac
Kudo Kingpin
Kudo Kingpin

Hi @WarrenBelz , thanks for your help.

 

That formula gives me :

Invalid argument type (number). Expecting a Text value instead.

sajarac
Kudo Kingpin
Kudo Kingpin

I have added to my Radio the "All" choice. Would this make things easier?

 

sajarac_0-1621461158911.png

 

Hi @sajarac ,

Where is the error referring to - I was simply using the values you posted as I cannot see your data. If it is zipcode, you need

Search(
   Filter(
      Market, 
      (
         Len(CboState.Selected.Result) = 0 || 
         State= CboState.Selected.Result
      ) && 
      (
         Len(CboCity.Selected.Result) = 0 || 
         City = CboCity.Selected.Result
      ) &&
      (
         Len(CboZipCode.Selected.Result) = 0 ||
         ZipCode = Value(CboZipCode.Selected.Result)
      ) &&
      Type = Radiol.Selected.Value
   ),
   TextSearchBoxl.Text,
   "Name"
)

 

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.

View solution in original post

sajarac
Kudo Kingpin
Kudo Kingpin

Hi @WarrenBelz , please apologize. I didn't explain correctly.

 

What I want is to be able to see the items in my gallery and be able to filter the gallery based in either

City or State, Zip or Type.

 

 

Hi @sajarac ,

When you refer to "either", the code I supplied will filter on all of them (if they have a value in the searching control)  - is this what you are wanting?

sajarac
Kudo Kingpin
Kudo Kingpin

Hi @WarrenBelz, for some reason I can not get both formulas working. I am getting errors.

 

After several attempts I have partially this formula working. I mean partially because if I have selected in my Radio1 the option "All" my gallery shows "All" and I am able to also filter the gallery by state and/or city and Zipcode.

 

But the TextSearchBox is not working.

 

If(Radio1.Selected.Value = "All",
Search(
Filter(
Market,
(CboState.Selected.Result = Blank() || State = CboState.Selected.Result) && (CboCity.Selected.Result = Blank() || City = CboCity.Selected.Result) &&
(CboZipCode.Selected.Result = Blank() || ZipCorrected = Text(CboZipCode.Selected.Result) ||
Type = Radio1.Selected.Value)),TextSearchBox1.Text,"Name"),
Search(
Filter(
Market,
(CboState.Selected.Result = Blank() || State = CboState.Selected.Result) &&
(CboCity.Selected.Result = Blank() || City = CboCity.Selected.Result) &&
(CboZipCode.Selected.Result = Blank() || ZipCorrected = Text(CboZipCode.Selected.Result)),
(Type = Radio1.Selected.Value)),TextSearchBox1.Text,"Name")) 

 

 

PS/ Never mind, TextSearch is working fine. I am testing behavior. I will let you know.

Thank you very much for your help.

 

Regards

Thanks @sajarac ,

Please let me know if the issue is solved for you.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,818)