cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
omi18
Post Patron
Post Patron

Filter Gallery Based on Button And / Or Toggle

Hello,

 

As shown below I have a gallery getting filtered by combo box and search field. What I'm trying to do is once we get results based on combo box selection. The user should be able to filter the gallery based on toggle tool selection. 

 

Screen Shot 2021-04-02 at 3.29.20 PM.png

 

Any Suggestions?

 

Thanks,

Omi

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @omi18 ,

Are you sure this is a numeric field (1 or 0)?  I suspect a Boolean (yes/no) as you have referred to Processed as one. Assuming the toggle is linked to Processed, then the Default of the toggle should be

Parent.Default

I am not sure where you are heading with the code you posted.

If you simply want to filter by Processed based on the Toggle value (whether it is linked to anything or not)

Sort(
   Search(
      Filter(
         'Database',
         Processed=YourToggleName.Value
      ),
      InsSearchBar_2.Text,
      "Name",
      "Team",
      "Fullname"
   ),
   LastName,
   Ascending
)

 

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

5 REPLIES 5
zmorek
Responsive Resident
Responsive Resident

Here's a nice short video on how to filter a gallery by multiple criteria:

https://www.youtube.com/watch?v=kLGglidmPxg

 

It should help! You might need to buttons to set a variable in order to have the gallery filter based on its value, but that should be about it.

WarrenBelz
Super User III
Super User III

@omi18 ,

You did not provide any code or field/control names, but this should be the syntax required

Search(
   Filter(
      YourListName,
      (
         IsBlank(YourComboBox.Selected.xxxx) || 
         YourFieldName=YourComboBox.Selected.xxxx
      ) &&
      YourYesNoFieldName.Value = YourToggleName.Value
   ),
   YourTextSeachBoxName,
   "YourFieldToSearchOn"
)

also xxxx will depend on the Items of your Combo Box.

 

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.

omi18
Post Patron
Post Patron

Hi @WarrenBelz ,

 

Thanks for your reply.

 

For Toggle1 I have a default property set to: Distinct(Filter('Database',ID=First(ComboBox.SelectedItems).ID),Processed) but getting an error "Boolean value expected"

And in the Database, I have 1 for True and 0 for False.

 

And For Gallery I Have: Sort(Search(Filter('Database',ID=ComboBox.Selected.ID,Hrs>0),InsSearchBar_2.Text,"Name","Team","Fullname"),LastName,Ascending)

 

And for the flag in the gallery Color set to: If(ThisItem.processed=true,RGBA(54, 176, 75, 1),RGBA(255, 191, 0, 1))

 

What I'm trying to achieve is once the user gets the result in the gallery then the gallery can be filtered based on the toggle. 

 

Let me know if you need more information.

 

Best,

Omi

Hi @omi18 ,

Are you sure this is a numeric field (1 or 0)?  I suspect a Boolean (yes/no) as you have referred to Processed as one. Assuming the toggle is linked to Processed, then the Default of the toggle should be

Parent.Default

I am not sure where you are heading with the code you posted.

If you simply want to filter by Processed based on the Toggle value (whether it is linked to anything or not)

Sort(
   Search(
      Filter(
         'Database',
         Processed=YourToggleName.Value
      ),
      InsSearchBar_2.Text,
      "Name",
      "Team",
      "Fullname"
   ),
   LastName,
   Ascending
)

 

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

omi18
Post Patron
Post Patron

Hi @WarrenBelz ,

 

it worked. 

 

Thanks,

Omi

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

Top Solution Authors
Top Kudoed Authors
Users online (82,246)