web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / GroupBy Choice Column
Power Apps
Unanswered

GroupBy Choice Column

(0) ShareShare
ReportReport
Posted on by 302
Trying to group by choice column. Added a blank gallery to my screen.
 
GroupBy(AddColumns(Grants,"ProjectText",Project.Value),"ProjectText","Data")
Doesnt work and throws me the following error message - 
The expression was intended to add a new column named "ProjectText" to the "Grants" table, with the values coming from the "Value" property of the "Project" record. After adding this column, the expression aims to group the resulting table by the "ProjectText" column and create a nested table with the grouped data under the column name "Data".

However, there are several errors in the expression:

1. **Expected identifier name**: This error indicates that the function is expecting a valid identifier (like a variable name) but is encountering something else, likely due to the use of `StringLiteral` instead of a direct string name.

2. **The function 'AddColumns' has some invalid arguments**: This suggests that the arguments provided to the `AddColumns` function are not correctly formatted or are not valid. Specifically, the use of `StringLiteral` for the column name is incorrect.

3. **The function 'GroupBy' has some invalid arguments**: Similar to the previous error, this indicates that the arguments for the `GroupBy` function are not valid, again likely due to the incorrect use of `StringLiteral` for the column names.

To fix these errors, the `StringLiteral` functions should be replaced with direct string literals for the column names.
 
Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    152,855 Most Valuable Professional on at
    You do not need quotes around the parameters
    GroupBy(
       AddColumns(
          Grants,
          ProjectText,
          Project.Value
       ),
       ProjectText,
       Data
    )
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee
  • honganhuynh1 Profile Picture
    302 on at
    Thank you Warren! That worked. I have a sharepoint list grouped by the choice column Project. So that's why i'm grouping it on the first screen.

    On selection of a project how do have gallery2 show the tasks associated with the selected project from gallery1?
  • WarrenBelz Profile Picture
    152,855 Most Valuable Professional on at
    You would filter (example below) by the selected record in the first gallery
    GroupBy(
       AddColumns(
          Filter(
             Grants,
             Project.Value = Gallery1.Selected.Project.Value
          ),
          ProjectText,
          Project.Value
       ),
       ProjectText,
       Data
    )
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 757 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard