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 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,992 Super User 2025 Season 1 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
sannavajjala87 Profile Picture

sannavajjala87 42 Super User 2026 Season 1

#2
Valantis Profile Picture

Valantis 31

#3
11manish Profile Picture

11manish 18

Last 30 days Overall leaderboard