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

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
Community Support Team
Community Support Team

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

Community Support Team
Community Support Team

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
Community Support Team
Community Support Team

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

karane
Level: Powered On

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!

Community Support Team
Community Support Team

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

karane
Level: Powered On

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
thirdimage

Power Apps 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

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,428)