cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
zmansuri
Super User
Super User

Help with Popup visibility through variable

Below is my App:

16.png

On the top right corner there is a view type text box that count the number of rows in gallery according to current filter.

 

17.png

 

this is my popup, i grouped it. I know i have to set Boolean variable in the visibility property of this group.

 

my  requirement is: When number of rows in gallery increases more than 2000. this popup should appear. and when someone clicks on ok button. pop should go away,

 

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@zmansuri 

Your going to kill the performance of your app with the way you have it on the OnChange like that.

Your Visible property of the Label should be: 

    (CountRows(yourGallery.AllItems)>=2000 ) && !lclAck

And the OnSelect action formula on the button:

    UpdateContext({lclAck: true})

The OnChange of the TextInput1 :     UpdateContext({lclAck: false})

 

NOW...here is the kicker.  Your Gallery will NOT have 2000 items in it, even if the results of your filter give you 2000 records.  Galleries page their rows.  You will see this if you have a large result of Items in the gallery and then scroll to the bottom, you'll see that the gallery expands more (you'll notice it from the scroll bar).

So, technically, none of the formulas will produce this result until the user actually scrolls to the bottom of the gallery enough to have the gallery actually contain 2000.

 

So, the only real way to get this information is to get it pre-gallery.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

5 REPLIES 5
RandyHayes
Super User
Super User

@zmansuri 

Firstly for your understanding, grouped controls do NOT have properties.  Grouping is just about putting controls in a group for easier maintenance in the app.

You will be concerned with the Visible property of the Button4 and Label11 controls.  Personally, I like to only have one formula that determines the visibility.  So for example, on your Label11 visible property have something like : CountRows(yourGallery.AllItems)>=2000  and then set the Visible property of the Button4 to : Label11.Visible

This way you only have one formula to concern yourself with.

 

I hope this is helpful for you.

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

I set the visible property of lable and button as you said. Its only popping up when rows are greater than 2000. What i want is close the popup when someone clicks that OK button.

RandyHayes
Super User
Super User

@zmansuri 

AH...I'm smacking myself on the head...forgot about the button to close it 🤣🤣  Sorry about that!

 

So, set the OnSelect Action of the Button to : UpdateContext({lclAck: true})

Then change the Visible property of the Label to :  (CountRows(yourGallery.AllItems)>=2000 ) && !lclAck

 

This will allow the user to acknowledge the warning and it will go away.  If you want the warning to re-appear in another search/filter, then simply put the UpdateContext({lclAck:false}) formula in your search/filter button or any place that would alter the items of your gallery.

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Below is my code on TextInput1 OnChange event. my textinput1 is counting number of rows in gallery. So when this value changes and if its more than 2000 it will set varpop to TRUE

19.png

Below is my code on Visible property on Button and Label

20.png

Below is my code on OnSelect event of the button.

21.png

i tried your way it was not working. So, i tried this way. still not working. What is the issue. Can you help please?

RandyHayes
Super User
Super User

@zmansuri 

Your going to kill the performance of your app with the way you have it on the OnChange like that.

Your Visible property of the Label should be: 

    (CountRows(yourGallery.AllItems)>=2000 ) && !lclAck

And the OnSelect action formula on the button:

    UpdateContext({lclAck: true})

The OnChange of the TextInput1 :     UpdateContext({lclAck: false})

 

NOW...here is the kicker.  Your Gallery will NOT have 2000 items in it, even if the results of your filter give you 2000 records.  Galleries page their rows.  You will see this if you have a large result of Items in the gallery and then scroll to the bottom, you'll see that the gallery expands more (you'll notice it from the scroll bar).

So, technically, none of the formulas will produce this result until the user actually scrolls to the bottom of the gallery enough to have the gallery actually contain 2000.

 

So, the only real way to get this information is to get it pre-gallery.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Users online (1,591)