cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
OsmandFernando
Post Prodigy
Post Prodigy

How to reset a gallery

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

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

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, 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

10 REPLIES 10
PowerAddict
Super User II
Super User II

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

@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

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

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

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

Yes, I did that brother @PowerAddict 

 

Osmand

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

@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

v-xida-msft
Community Support
Community Support

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, 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,483)