cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
brandonkparker
New Member

Single Page App - I am on the struggle bus :)

Hi Everyone,

 

I am on the struggle bus. 

 

I am trying to build a single page app, where the user moves from screen to screen filling out forms and forms hide/appear based on the button clicked. 

 

I am using this post as reference.

 

Solved: Re: Power apps - Show/Hide Button - Power Platform Community (microsoft.com)

 

 

If I set the variable to TRUE, I can run the app and click the button and the form appears. However, if I set it to FALSE, then the form disappears on app run (it should disappear on button press). Basically, I need the form to be visible, and on click of the button, it becomes invisible. I need to do this functionality with dozens of forms in this app to create a single page app. 

 

Any ideas?!

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@brandonkparker 

My suggestion is that you get rid of the concept of a variable for every form and use just one.

 

I cannot tell if the left buttons are part of a Gallery or if you actually added each button by hand.

But, the concept here is this:

Set one variable to the name (or number or whatever you want) of the form you want to display.

So, for example on the Patient Info button in the left nav,  Set a variable to a name:  Set(glbCurrentForm, "PatientInfo")

Now, on the Visible property of the Patient Info form, set it to : glbCurrentForm = "PatientInfo"

That form will then only be visible when that variable contains that value.

Do the same on all the other buttons and forms.

For you button in the form that you show, you can do one of two things:

1) Set the variable to blank - Set(glbCurrentForm, Blank())  This will make all forms disappear

2) Set the variable to the next form you want to show: Set(glbCurrentForm, "PatientInfo2")

 

This will give you much less variable juggling and will let you craft the flow of your app much better.

 

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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
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

3 REPLIES 3
RandyHayes
Super User
Super User

@brandonkparker 

My suggestion is that you get rid of the concept of a variable for every form and use just one.

 

I cannot tell if the left buttons are part of a Gallery or if you actually added each button by hand.

But, the concept here is this:

Set one variable to the name (or number or whatever you want) of the form you want to display.

So, for example on the Patient Info button in the left nav,  Set a variable to a name:  Set(glbCurrentForm, "PatientInfo")

Now, on the Visible property of the Patient Info form, set it to : glbCurrentForm = "PatientInfo"

That form will then only be visible when that variable contains that value.

Do the same on all the other buttons and forms.

For you button in the form that you show, you can do one of two things:

1) Set the variable to blank - Set(glbCurrentForm, Blank())  This will make all forms disappear

2) Set the variable to the next form you want to show: Set(glbCurrentForm, "PatientInfo2")

 

This will give you much less variable juggling and will let you craft the flow of your app much better.

 

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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

Perfect! Thanks Randy. That is a better way to do this.

RandyHayes
Super User
Super User

@brandonkparker 

Yes...much smoother!  

If this works for you, be sure to accept my response before as a solution so that others looking to do this, can find solutions quickly.  Thanks!

_____________________________________________________________________________________
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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (5,169)