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
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

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