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

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,293)