cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
karane
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
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

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

karane
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!

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

karane
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
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

Attending MBAS? Claim your badge

Attending MBAS? Claim your badge

Whether you’re streaming the digital event live, or watching on-demand, claim your attendee badge to sport on your profile.

‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

‘Better Together’ Integration Forum Launch

‘Better Together’ Integration Forum Launch

We're launching a how-to forum where you can learn about how Power BI integrates with other Power Platform products.

Emergency Response & Monitoring Solution

Emergency Response & Monitoring Solution

Microsoft has created a regional government emergency response and monitoring solution that is built on Power Apps and Power BI.

Top Solution Authors
Top Kudoed Authors
Users online (5,163)