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!
Solved! Go to Solution.
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
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
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?
Bumping this, incase someonw knows a solution for my second question
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.
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.
User | Count |
---|---|
255 | |
252 | |
83 | |
42 | |
31 |
User | Count |
---|---|
323 | |
267 | |
123 | |
70 | |
52 |