cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sajarac
Super User
Super User

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
Super User
Super User

Hi @WarrenBelz , thanks for your help.

 

That formula gives me :

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

sajarac
Super User
Super User

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.

sajarac
Super User
Super User

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
Super User
Super User

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
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (2,018)