Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

How to Reset Gallery and Gallery ComboBox when Form is Submitted

(1) ShareShare
ReportReport
Posted on by 4,976 Super User 2025 Season 1

I have Screen_1 and Screen_2.

Screen_1 has Form_1, Screen_2 has Gallery_1.

Gallery_1 has ComboBox_1, which has the following formula in items -

If(Role_DataCardValue.Text = "Contractor",Filter(Staking_Collection,Cost_Type = "Subcontractor" && Title =
     Dashboard_Screen_Location_Dropdown.Selected.Value).Billing_Unit_and_Description,

If(Role_DataCardValue.Text = "Technician",Filter(Staking_Collection,Cost_Type = "In House" && Title =
     Dashboard_Screen_Location_Dropdown.Selected.Value).Billing_Unit_and_Description))

I want Gallery_1 and the ComboBox_1 to clear once Form_1 has been successfully submitted.

The submit form button is on Screen_1 (Gallery_1 is on Screen_2).

I have tried the following formula - 
     Set(varActivityComboBox,[])

I have also tried the following formula in the same manner -
     UpdateContext({varActivityComboBox:false});
     UpdateContext({varActivityComboBox:true});

I've placed the above in a Reset_Btn (on Screen_1), it does reset Gallery_1 and does reset ComboBox_1.

When I place the same formulas in the Form_1 'OnSuccess', and the form is submitted successfully, it does not clear Gallery_1 or ComboBox_1.

Gallery_1 items - 
     Filter(colBillableUnits, !rem)

Screen_2: Gallery_1 and ComboBox_1 -

Phineas_0-1721155773583.png

 


  • Suggested answer
    MRavi Profile Picture
    on at
    How to Reset Gallery and Gallery ComboBox when Form is Submitted
    To achieve the desired behavior of clearing Gallery_1 and ComboBox_1 upon successful submission of Form_1, you can follow these steps. Since the Reset function does not seem to work within the OnSuccess property of Form_1, you can try resetting the Gallery_1 and ComboBox_1 by triggering the reset action through a variable.
     
    1. Create a context variable to control the reset:

    In Form_1's OnSuccess property, set a context variable that will be used to trigger the reset. Let's call this variable resetControls.

    UpdateContext({resetControls: true});

    2. Modify the Reset_Btn button to reset the context variable:

    Add a button (you can hide it if you don't want it to be visible) to reset the resetControls variable to false.

    Reset_Btn.OnSelect: UpdateContext({resetControls: false});

    3. Use the resetControls variable to reset the Gallery_1 and ComboBox_1:

    In the properties of Gallery_1 and ComboBox_1, use the Reset function along with the resetControls variable.

    For ComboBox_1:

    ComboBox_1.Default: If(resetControls, Blank(), ComboBox_1.Default)

    For Gallery_1:

    Gallery_1.Items: If(resetControls, [], Filter(colBillableUnits, !rem))

    4. Trigger the reset button after form submission:

    After updating the context variable to true in the OnSuccess property of Form_1, trigger the reset button to reset the context variable to false.

    Form_1.OnSuccess: UpdateContext({resetControls: true}); Select(Reset_Btn)

    This approach ensures that when Form_1 is successfully submitted, the resetControls variable is set to true, which triggers the reset logic in ComboBox_1 and Gallery_1. The Reset_Btn then sets resetControls back to false to reset the state.

    By using this method, you should be able to clear the Gallery_1 and ComboBox_1 upon successful submission of Form_1.

  • Michael E. Gernaey Profile Picture
    43,442 Super User 2025 Season 1 on at
    How to Reset Gallery and Gallery ComboBox when Form is Submitted
    Hi
     
    i am not sure what you mean by it resets the Gallery. Galleries don’t have reset abilities. You have to use the Visible property to fake one. 
     
    the combo is that inside or outside the gallery? I am guessing outside and it somehow impacts the gallery items?
     
    Now, I assume you have the Reset variable in the Reset of the Combo??
     
    if so, it should work. Here is what I would try 
     
    above your update context variable put a Trace(“going true”);
    then turn true
    Trace(“going false”);
    then turn false 
     
    try again and see if it works. If not, please run your app under Monitor and verify on success the Trace statements work
     
     
     

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 770 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 494

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 399