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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,435)