cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gchris7
New Member

GroupBy Displayname in Gallery

Hi All,

 

Im trying to Create an A gallery that will display some Data pulled from a Sharepoint list. I want the data to be grouped by the DisplayName of a persons Field in that list but it doesnt seem to work.

Im using the following formula:

GroupBy(MySharepointList,"MyUserField.Displayname","GroupByUsersDisplayName")

The grouping works properly when i use a simple text field from that same list.

 

Also is this possible to do it using a table in Powerapps or Gallery is the only way?

 

Thanks in advance!

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi there!

Unfortunately we don't currently support nested relationships in GroupBy, i.e "Myuserfield.DisplayName".

To make this work, you need to add the field you want to groupby as it's own column.

Try:

GroupBy(AddColumns(MySharepointList, "UserDisplayName", MyUserField.DisplayName), "UserDisplayName", "GroupByUsersDisplayName")

 

Let me know if this works for you!

 

lesaltzm

View solution in original post

7 REPLIES 7
gchris7
New Member

Anyone knows how this can be done?

Hi there!

Unfortunately we don't currently support nested relationships in GroupBy, i.e "Myuserfield.DisplayName".

To make this work, you need to add the field you want to groupby as it's own column.

Try:

GroupBy(AddColumns(MySharepointList, "UserDisplayName", MyUserField.DisplayName), "UserDisplayName", "GroupByUsersDisplayName")

 

Let me know if this works for you!

 

lesaltzm

View solution in original post

Thank you lesaltzm. It worked great!

 

Now im trying to add the jobtitle of these users but im getting errors again. I tried the bellow but nothing worked.

 

GroupByUsersDisplayName.MyUserField.JobTitle

GroupByUsersDisplayName.UserDisplayName.JobTitle

AddColumns(GroupByUsersDisplayName, "JobTitle", MyUserField.JobTitle)

 

Any ideas?

gchris7
New Member

Bumping this, incase someonw knows a solution for my second question

tnic
New Member

In the Text function of the Gallery label control, try:

 

Lookup(MySharePointList, UserDisplayName = ThisItem.UserDisplayName).MyUserField.JobTitle

 

This will also work in an image control to display the user picture.

avitas
Frequent Visitor

I get invalid name. This identifier is not recognized ("UserDisplayName=", that is...?

The field "UserDisplayName" is the example used earlier in this thread. It represents the name of the new SharePoint text field you create to store the user's DisplayName as text. This new field is then used to successfully create the Gallery GroupBy for a person. Replace UserDisplayName in both places in the formula with your field name.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (99,353)