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

Listing users based on First Name

Hello, I am working on an employee directory power app and my gallery only shows about 100 items max. I was wondering if I can fix this by displaying employees that have first names that start with A-F on one page, G-M on one page and  N-Z on one page. So when a user clicks G-M the page updates to show records of employees with a first name between G-M. I attached an image to show what I am thinking about. If this is possible, how would I go about implementing it?

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Listing users based on First Name

Hi @karane,

 

 

If you prefer to use button to filter the Gallery, then please follow the steps below:

1. Add three button, change the Text Property of the Button to:

"A-F", "G-M", "N-Z"

2. Under the OnSelect property of button A-F, enter the formula below:

Set(Var1,["A","B","C","D","E","F"])

G-M button OnSelect property:

Set(Var1,["G","H","I","J","K","L","M"])

N-Z OnSelect property:

Set(Var1,["N","O","P","Q","R","S","T","U","V","W","X","Y","Z"])

3. Under the item property of the gallery, enter the following:

If(!IsEmpty(Var1),Filter(Employee,Left(FirstName,1) in Var1.Value),Employee)

4. Under the OnVisible property of the Screen (this is used to Reset the filter):

Set(Var1,[])

Reference:

Filter.gif

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Community Support
Community Support

Re: Listing users based on First Name

Hi @karane,

 

Yes, just add the code behind the existing one under the OnVisible property.

 

For the filter with Officec 365 use, switch the formula as below:

Sort(
Filter(Office365Users.SearchUser(),
Len(GivenName) > 0,
IsMatch(Mail, "@laner.org",
Contains & IgnoreCase),
!IsBlank(Department), !IsBlank(JobTitle),
Left(DisplayName, 1) in Var1.Value),
GivenName,
Ascending)

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Highlighted
Community Support
Community Support

Re: Listing users based on First Name

Hi @karane,

 

 

If you prefer to use button to filter the Gallery, then please follow the steps below:

1. Add three button, change the Text Property of the Button to:

"A-F", "G-M", "N-Z"

2. Under the OnSelect property of button A-F, enter the formula below:

Set(Var1,["A","B","C","D","E","F"])

G-M button OnSelect property:

Set(Var1,["G","H","I","J","K","L","M"])

N-Z OnSelect property:

Set(Var1,["N","O","P","Q","R","S","T","U","V","W","X","Y","Z"])

3. Under the item property of the gallery, enter the following:

If(!IsEmpty(Var1),Filter(Employee,Left(FirstName,1) in Var1.Value),Employee)

4. Under the OnVisible property of the Screen (this is used to Reset the filter):

Set(Var1,[])

Reference:

Filter.gif

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Frequent Visitor

Re: Listing users based on First Name

Hi @v-micsh-msft

But I am using the following under the items part of gallery: 

Sort(Filter(Office365Users.SearchUser(), Len(GivenName) > 0, IsMatch(Mail, "@laner.org", Contains & IgnoreCase), !IsBlank(Department), !IsBlank(JobTitle)), GivenName, Ascending)

How would I incorporate your code while still pulling information from office 365?

Also, when I used your items property of gallery on a different screen I get the error: The function "Left" has some invalid arguments.

 

Also, under the OnVisible property of screen I have:

UpdateContext({searchReset:true});
UpdateContext({searchReset:false});
ClearCollect(myProfile, {profile : Office365Users.MyProfile()})

Would I just add the onvisible code you gave to the end?

Thank you!

Highlighted
Community Support
Community Support

Re: Listing users based on First Name

Hi @karane,

 

Yes, just add the code behind the existing one under the OnVisible property.

 

For the filter with Officec 365 use, switch the formula as below:

Sort(
Filter(Office365Users.SearchUser(),
Len(GivenName) > 0,
IsMatch(Mail, "@laner.org",
Contains & IgnoreCase),
!IsBlank(Department), !IsBlank(JobTitle),
Left(DisplayName, 1) in Var1.Value),
GivenName,
Ascending)

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Frequent Visitor

Re: Listing users based on First Name

Thanks @v-micsh-msft,

 

It seems that office 365 connector is only pulling information up to initial "D". Before I used Office365Users.SearchUser() in the gallery property and it should have listed all the records but it only went till "D". Your buttons do work but I guess powerapps is only pulling information up to initial "D". Thanks!

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,673)