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 / Reset Gallery items to...
Power Apps
Answered

Reset Gallery items to table value in Fluent UI controls in PowerApps for Microsoft Teams

(0) ShareShare
ReportReport
Posted on by 13

I'm trying to define a cancel button to roll back any changes made by the user to the gallery items (combo, date picker etc). Given fluent UI controls doesn't seem to have a reset option, I was able to define a button within the gallery and call reset for all the controls in the gallery item (reset for gallery items cant be called from outside of gallery per reset documentation).  This works if I click the button on each row.

 

The problem - 

My cancel button is outside the gallery. I added a onSelect to the gallery (if(lvarGalleryMode = "CLEAR", Select(ClearButton)) and then reset the controls as before in the button before resetting my variable to missing. 

This again works only for one row (since variable gets set to missing). I tried using a for all with a toggle to cycle through all modified items - but my select stops working giving a message that Select has invalid arguments. Also when I try to get a count for modified rows the delegation kicks in and the count is not accurate. 

 

Any suggestions on

a. how to do the select for each modified row Clearbutton

OR

b. Simpler method to reset the gallery with these fluent UI controls?

 

Categories:
  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @PowerNewUser ,

     

    Would you like to make the Gallery items back to the original status and discarding all modifications in it with clicking a "reset" button?

     

    If so, you may consider using a collection to temporarily store the original items of the table, use this collection as the data source of the Gallery. Then if users would like to reset and discard all modifications in the Gallery they could simply achieve this via re-creating the collection.

     

    1\ Assuming there is a table or collection which you are using as the data source of the Gallery, create an additional collection to store all items:

    ClearCollect(colTemp, YourGalleryDataSource)

     

    2\ Use this collection colTemp as the current data source of the Gallery. All the modifications need to patch to the new temp collection.

     

    3\ Add a button, set OnSelect of the Button to re-create the collection

    ClearCollect(colTemp, YourGalleryDataSource)

     

    4\ To avoid accidentally click the reset button, you'd better add a popup screen for warning. So modify OnSelect of the reset button to:

    Navigate(PopUpScreen)

     

    On the Label of warning message, set Text:

    "This will reset/discard all modifications, do you confirm?"

     

    OnSelect of the confirm button:

    ClearCollect(colTemp, YourGalleryDataSource);Navigate(GalleryScreen)

     

    OnSelect of the Cancel button:

    Navigate(GalleryScreen)

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • PowerNewUser Profile Picture
    13 on at

    Thank you. It does work - however the reset of the control works only when I navigate screens. If I try to refresh the collection without the confirmation screen (using a clearCollect in onSelect for cancel button), it doesn't reset. It seems like navigate is forcing the reload of the gallery. Any way to do it without Navigation? If not will proceed with this approach

     

  • PowerNewUser Profile Picture
    13 on at

    I ended up taking a different approach but the proposed solution would work for anybody facing the same issue. 

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard