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 Pages / Ungroup not working as...
Power Pages
Suggested Answer

Ungroup not working as expected from a gallery

(0) ShareShare
ReportReport
Posted on by 97
I have two collections. A button groups data from the first collection, groups it by a key field, and adds it to a second collection while removing those items from the first collection. The second collection is displayed to the user in a gallery. If they want to remove that item from the gallery, those records need to go back to the first collection. The issue I'm having is that I expected to be able to simple ungroup the item and patch it back into the first collection. However, this code doesn't work:
Ungroup(ThisItem,UserDetail)
 
It doesn't recognize that the item is something that can be ungrouped and I'm not sure how to reference it.
 
This is the function that adds items to the second collection:
Collect(colCollection2,GroupBy(Filter(colCollection1,Key=Gallery2_2.Selected.Key),Key,UserDetails));
 
Shouldn't I be able to ungroup the item?
Categories:
I have the same question (0)
  • Suggested answer
    SaiRT14 Profile Picture
    1,990 Super User 2025 Season 2 on at
    Check this out
     
    ForAll(
        Ungroup(Filter(colCollection2, Key = ThisItem.Key), "UserDetails"),
        Collect(colCollection1, ThisRecord)
    );
     
    RemoveIf(colCollection2, Key = ThisItem.Key);
     
     

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 Pages

#1
Fubar Profile Picture

Fubar 78 Super User 2025 Season 2

#2
Jerry-IN Profile Picture

Jerry-IN 75

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard