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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / accessing grouped colu...
Power Apps
Answered

accessing grouped column values in collection

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a collection that groups items from my data source and am trying to patch to my data source using:

ForAll(
submitProjects,
Patch(
Project_Time_Master,
Defaults(Project_Time_Master),
{
Title: Name,
WeekStarting: WeekStarting,
Project: Project,
Task: Task,
Monday: Monday,
Tuesday: Tuesday,
Wednesday: Wednesday,
Thursday: Thursday,
Friday: Friday,
Saturday: Saturday,
Sunday: Sunday
}
)
);

 

I keep getting errors that say the name isn't valid (on line with Task), and "the type of this argument Project doesn't match the expected value Text.

 

submit projects is a grouped collection and I'm guessing I'm not accessing the nested columns correctly - can someone help me with the syntax for this?

Categories:
  • mdevaney Profile Picture
    29,993 Moderator on at

    @Anonymous

    You said this item was supposed to receive a text value.

     

    Project: Project

     

    I am not sure what the 2nd Project refers to but you'll need to either put a Text value between quotes or reference something that outputs a Text value

    Project: "Project Name"
    Project: TextInput1.Text

     

    Can you please explain what the nested columns should look like?  Its fairly easy to show you if I know what the goal is.

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    "Project" is a column in a grouped field (GroupedWeeks) within a collection. I am trying to update the "Project" field in my SP list which is a single line of text and not grouped - I think I'm just not accessing that nested column within "GroupedWeeks" correctly to get that project text value. 

     

  • mdevaney Profile Picture
    29,993 Moderator on at

    @Anonymous

    I'll need a visual of some kind to truly understand what is going on here 🙂

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    The first picture is the grouped collection - the second picture is the expanded grouped column and "Project" is the value I am trying to access, and the third picture is just the title of the expanded column.

     

    I am using a gallery with checkboxes that when checked, adds the entry in the gallery to this grouped collection and removes when they are unchecked. I have a submit button that loops through the collection and submits all the checked items and then clears the collection. The code I have associated with said button is below.

     

    ForAll(
    submitProjects,
    Patch(
    Project_Time_Master,
    Defaults(Project_Time_Master),
    {
    Name: GroupedWeeks.Title,
    WeekStarting: WeekStarting,
    Project: Project, <-----need to return text value here 
    Task: GroupedWeeks.WorkCompleted,  <-----Attempt at accessing the grouped columns in the collection
    Monday: Monday,
    Tuesday: Tuesday,
    Wednesday: Wednesday,
    Thursday: Thursday,
    Friday: Friday,
    Saturday: Saturday,
    Sunday: Sunday
    }
    )
    );
    Refresh(Project_Time_Master);
    Refresh('Project Time System');
    ForAll(
    submitProjects,
    Remove('Project Time System', LookUp('Project Time System', ID = submitProjects.GroupedWeeks[@ID])));
    RemoveIf(submitProjects, WeekStarting in Project_Time_Master.WeekStarting);

     

    Project Time System is an employee view of submitted time on a given project - when the button is pressed the entry is from PTS to a Master sheet where management approves or denies.

    The way it was setup until my requirements changed - Project : Project - patched just fine but now because Project is in the grouped column it obviously won't work - I need to access that value and the others in that grouped collection

    Capture.PNG
    Capture.PNG
    Capture.PNG
  • mdevaney Profile Picture
    29,993 Moderator on at

    @Anonymous 

    All of those 3 pictures are the same.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Sorry about that - fixed

    Capture.PNG
    Capture1.PNG
  • mdevaney Profile Picture
    29,993 Moderator on at

    @Anonymous 

    You could get the project name "Micro-Services" like this.  Try it out by putting this in the Text property of a label.  I was able to identify the specific row by its ID number.

     

    LookUp(Ungroup(submitProjects,"GroupedWeeks"),ID=205,Project Name))

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Ok cool - that's a push in the right direction - now since it's in a ForAll statement, that ID column is going to change based on what the SP list assigns to it - so everytime I ungroup something does that mean I have to regroup the collection? This is a company wide time keeping app so there are going to be many more entries

  • mdevaney Profile Picture
    29,993 Moderator on at

    @Anonymous 

    The "Ungroup" does not change the original collection.  It simply gives you access to the values of a Table stored in the collection.  There is no need to "Regroup" 🙂

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Ok, one last thing - since I'm not looking for a specific record - I just want to patch everything as a new record into one of my data sources - I'm using:
    //fix stuff
    ForAll(
    submitProjects,
    Patch(
    Project_Time_Master,
    Defaults(Project_Time_Master),
    {
    Name: GroupedWeeks.Title,
    WeekStarting: WeekStarting,
    Project : LookUp(Ungroup(submitProjects, "GroupedWeeks"), )
    Task : WorkCompleted,
    Monday: Monday,
    Tuesday: Tuesday,
    Wednesday: Wednesday,
    Thursday: Thursday,
    Friday: Friday,
    Saturday: Saturday,
    Sunday: Sunday
    }
    )
    );

    Clearly I have to ungroup each one of those statements so I can get to the field I need - I don't really need to LookUp  a specific record - just submit everything - what do? 🤣

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 350 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 318

#3
Mohsin Ali Profile Picture

Mohsin Ali 220

Last 30 days Overall leaderboard