cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
spow5666
Frequent Visitor

Filter data displayed in Browse Gallery.

I am trying to create a Timesheet app using Excel in OneDrive for Business as a data source and target.  I created the app using the Employees table as the initial data source. PowerApps automatically created BrowseScreen1 which lists all Employees. It has a text search on Employee_Name so users can find themselves and then tap NextArrow1 to go to DetailScreen1.

I only want to include active employees in the browse gallery, i.e. select * from Employees where Active_Ind = 'TRUE'. 

BrowseGallery1 currently has Items defined as

 

SortByColumns(Search([@Employees], TextSearchBox1.Text, "Employee_Name"), If(SortDescending1, Descending))

 

How can I filter the records listed in the browse gallery to only include active employees? 

1 ACCEPTED SOLUTION

Accepted Solutions

@yashag2255 that didn't quite work but I've figured out a way to get it done. 

I changed the Active_Ind values in the Excel sheet to 1 for true, 0 for false and formatted as a number.  My formula now looks like this: 

SortByColumns(Filter(Search([@Employees], TextSearchBox1.Text, "Employee_Name"),Active_Ind=1), If(SortDescending1, Descending))

I wish I knew why it didn't work before; it could be that having a value of TRUE confuses powerapps in some way. 

Thanks for your help.

View solution in original post

2 REPLIES 2
yashag2255
Dual Super User II
Dual Super User II

Hi @spow5666 

 

You can update the expression as:

SortByColumns(Search(Filter([@Employees],Active_Ind = 'TRUE'), TextSearchBox1.Text, "Employee_Name"), If(SortDescending1, Descending))

I am assuming that Active_Ind is a text type field here, if this is a boolean field, you can use:

SortByColumns(Search(Filter([@Employees],Active_Ind = true), TextSearchBox1.Text, "Employee_Name"), If(SortDescending1, Descending))

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

@yashag2255 that didn't quite work but I've figured out a way to get it done. 

I changed the Active_Ind values in the Excel sheet to 1 for true, 0 for false and formatted as a number.  My formula now looks like this: 

SortByColumns(Filter(Search([@Employees], TextSearchBox1.Text, "Employee_Name"),Active_Ind=1), If(SortDescending1, Descending))

I wish I knew why it didn't work before; it could be that having a value of TRUE confuses powerapps in some way. 

Thanks for your help.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (20)