cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
slong
Frequent Visitor

Using GroupBy with a subtable column name ?

Is there a way to use a column name in a sub table of a collection in the GroupBy function ?

My top level Collection looks like this 

slong_1-1612261232277.png

If I click on the fields table I get the following 

slong_2-1612261795039.png

I want to be able to be able to get all items assigned to a user but group them by a column in the subtable (i.e. the customfield_10014 column of fields). 

I've tried this 

 

GroupBy(Filter(jiraRawData, fields.assignee.displayName = varSelectedUser), "fields.customfield_10014", "grouped")

 

but get the following error 

slong_3-1612261991578.png

I'm all out of ideas. Any assistance much appreciated.

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @slong :

Firstly,let me explain why you encountered this problem.

it is not available to group a table by a column in the sub-table.

Secondly,I suggest you first use AddColumns to extract the values in the sub-records.Please try this solution:

I assume that the value of fields is a record and not a table:

1\My data source:

ClearCollect(
    jiraRawData,
    {
        fields: {
            assignee: {displayName: "bof"},
            customfield_10014: "1"
        }
    },
    {
        fields: {
            assignee: {displayName: "bof"},
            customfield_10014: "2"
        }
    }
)

2\The Formula

GroupBy(
AddColumns(
   Filter(jiraRawData, fields.assignee.displayName = varSelectedUser),
   "NewCustomfield_10014",
   fields.customfield_10014
)
"NewCustomfield_10014",
"grouped"
)

Best Regards,

Bof

 

View solution in original post

1 REPLY 1
v-bofeng-msft
Community Support
Community Support

Hi @slong :

Firstly,let me explain why you encountered this problem.

it is not available to group a table by a column in the sub-table.

Secondly,I suggest you first use AddColumns to extract the values in the sub-records.Please try this solution:

I assume that the value of fields is a record and not a table:

1\My data source:

ClearCollect(
    jiraRawData,
    {
        fields: {
            assignee: {displayName: "bof"},
            customfield_10014: "1"
        }
    },
    {
        fields: {
            assignee: {displayName: "bof"},
            customfield_10014: "2"
        }
    }
)

2\The Formula

GroupBy(
AddColumns(
   Filter(jiraRawData, fields.assignee.displayName = varSelectedUser),
   "NewCustomfield_10014",
   fields.customfield_10014
)
"NewCustomfield_10014",
"grouped"
)

Best Regards,

Bof

 

View solution in original post

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!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,251)