Skip to main content

Notifications

Power Platform Community / Forums / Design & Build / Ungroup not working as...
Design & Build
Suggested answer

Ungroup not working as expected from a gallery

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:
  • Suggested answer
    SaiRT14 Profile Picture
    SaiRT14 317 on at
    Ungroup not working as expected from a gallery
    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

September 2024 Newsletter…

September 2024 Community Newsletter…

Community Update Sept 16…

Power Platform Community Update…

Tuesday Tip #2 Global Search…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 142,008

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,531

Leaderboard

Featured topics