cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

How to Filter Toggle

How to use Toggle and filter for specific column value in the Gallery

e.g if Toggle = True then show values in gallery for records in column Completed = Yes only

 

4 REPLIES 4
PowerApps Staff murali
PowerApps Staff

Re: How to Filter Toggle

You can use Filter function to achieve that. 

 

e.g.

Gallery.Items = Filter(Values, If(Toggle1.Value, Completed = "Yes", Completed = "No"))

 

Murali

Anonymous
Not applicable

Re: How to Filter Toggle

Thanks for the reply Murali really appreciate your help.

 

Following is my current function in Gallery.Items

 

SortByColumns(Search(Table2, TextSearchBox1.Text,"Amount (SGD)","Consultant","Cost Center","Cost Type"), "Amount (SGD)", If(SortDescending1, Descending, Ascending),)

 

So how to I Incorporate below code inside to Gallery.Items function.

 

Filter( Table2, If(Toggle1.Value, "Completed" = "Yes", "Completed" = "No"))

 

 I do need to have both these codes to fullfill my task. Please help on this.

hpkeong
Level 10

Re: How to Filter Toggle

Hi

 

One of the solution:

- Use ClearCollect( Collection, Item, ... )

- Set the Gallery.Items = Collection

 

Hope the screenshot helps.

 

Screenshot (42).pngWhen you toggle = Completed, it shows only YES data. If search, please enter search string, and click anyway on the screen to start searching.

hpkeong
Anonymous
Not applicable

Re: How to Filter Toggle

Did you ever figure this out? I'm trying to achive the exact same thing; I have the same Gallery.items function as you and I need to add a toggle in to filter by values in a column (i.e. Yes, No). I can't seem to find any explanation on the syntax when combining multiple functions, such as Filter & Search. 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

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