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,990 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
DP_Prabh Profile Picture

DP_Prabh 41

#2
oliver.rodrigues Profile Picture

oliver.rodrigues 35 Most Valuable Professional

#3
rezarizvii Profile Picture

rezarizvii 28

Last 30 days Overall leaderboard