web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to reset a gallery
Power Apps
Answered

How to reset a gallery

(0) ShareShare
ReportReport
Posted on by

Hi @PowerAddict , brother. 

 

I am so happy so far as I learnt a lot from experts like you. 

 

I want to reset the gallery2 when I click on the +

At the moment gallery2 linked to the main Gallery selection. as follows, 

 

Item ---- >Filter(SalesDetails_1,'Invoice Number'.Value = BrowseSalesNew_1.Selected.Title)

 

When click on the + gallery2 should be blank, how can I do that ?

 

Capture.PNG

Categories:
I have the same question (0)
  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at
    Do you just want to hide your Gallery 2 when someone clicks on the + sign and then do you want to make it visible when somebody clicks on a Galley1 item?

    If so, you could have a variable that is set to false by default (may be on the OnVisible property of the screen) and then on the OnSelect property of the Gallery1, you could make that variable set to true. On the OnSelect property of the + sign, you could again set the variable back to false.

    Let me know if this doesn't work or if this isn't what you were looking for.

    ---
    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

    Hardit Bhatia
    https://thepoweraddict.com
  • OsmandFernando Profile Picture
    on at

    @PowerAddict Thank you for your reply. 

     

    Actually what I want to is to clear the Gallery2 when I am going to enter a new Item in the form above the Gallery2. When I am clicking the + icon now the gallery 2 still showing the selected item related to the main gallery 

     

    Osmand

  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at
    The visible property should achieve what you want.

    However, you can try the following as well:

    1. Set the default property of Gallery1 to {}.

    2. And then on the OnSelect property of the + sign, do Reset(Gallery1)

    Let me know if this helps.

    ---
    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

    Hardit Bhatia
    https://thepoweraddict.com
  • OsmandFernando Profile Picture
    on at

    I tried the steps, @PowerAddict 

    But the gallery2 (should be gallery2) did not reset

     

    on the + i did like this, 

    NewForm(SalesEditNewFormAddData_1)&Reset(Gallery2)

     

    any issue ?

     

    Osmand

  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at
    Do you have the default property of Gallery2 set to {} ?

    ---
    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

    Hardit Bhatia
    https://www.thepoweraddict.com
  • OsmandFernando Profile Picture
    on at

    Yes, I did that brother @PowerAddict 

     

    Osmand

  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at

    So this is how I made it work: 

     

    Set {} as the default for both Gallery 1 and Gallery 2. Set the OnSelect property of the + button to Reset(Gallery1);Reset(Gallery2). 

     

    This should work. Check this out: 

     

    GalleryReset.gif

     

    Let me know if this doesn't help. 

     

    ---
    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

    Hardit Bhatia
    https://www.thepoweraddict.com

  • OsmandFernando Profile Picture
    on at

    @PowerAddict  Thank you so much for taking time on me. I really appreciated

    Main Gallery.PNGGallery2.PNG

     

    Following is how the onselect of +

     

    NewForm(SalesEditNewFormAddData_1);Reset(BrowseSalesNew_1);Reset(Gallery2);

     

    Osmand

  • Verified answer
    v-xida-msft Profile Picture
    on at

    Hi @OsmandFernando ,

    Could you please share a bit more about your scenario?

    Do you want to clear your Gallery2 Items when you press the "+" icon?

     

    Based on the needs that you mentioned, I think a global variable could achieve your needs. I have made a test on my side, please consider take a try with the following workaround:

    Set the OnSelect property of the ">" icon within your BrowseSalesNew_1 gallery or the OnSelect property of the BrowseSalesNew_1 to following:

    Set(SelectedItem, true)

    Set the OnSelect property of the "+" button to following:

    Set(SelectedItem, false)

    Set the Items property of the Gallery2 to following:

    If(
     SelectedItem,
     Filter(SalesDetails_1, 'Invoice Number'.Value = BrowseSalesNew_1.Selected.Title)
    )

    Note: When you want to see the details of a Invoice record, please select the specific item in your BrowseSalesNew_1 Gallery, then the details would be displayed within your Gallery2.

    Please consider take a try with above solution, then check if the issue is solved.

     

    Best regards, 

  • OsmandFernando Profile Picture
    on at

    @v-xida-msft  @PowerAddict  much thankful for the support

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard