cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
spow5666
Level: Powered On

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
spow5666
Level: Powered On

Re: Filter data displayed in Browse Gallery.

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

Re: Filter data displayed in Browse Gallery.

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!

spow5666
Level: Powered On

Re: Filter data displayed in Browse Gallery.

@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
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,129)