cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
VDeepakHadpad
Microsoft
Microsoft

How to be reuse updateconectext variable to naviagte to form on multiple button click?

Hi Folks,

 

I have been implemented screen & inside newform , I want to create a variable to store the value initially false ex: updatecontext(variablename : false) and on newform visible property i want to set that variable.

and onclick of button i want to put updatecontext(variable name : true) so that form should be visiable.

 

How do I achieve  this on onbutton click? 

 

Thanks ,

Deepak

1 ACCEPTED SOLUTION

Accepted Solutions

You could put it in the screen's onvisible event, which would set it to false each time the user navigated to that screen. Alternatively, you could put it in the navigate function that is used to get to that screen. For example, if your form that you're hiding/showing is on screen2, and if there's a button on screen1 that navigates the user to screen2, in the button's onselect you could put:

 

Navigate(Screen2,ScreenTransition.None,{showform:false})

 

This would allow some flexibility, as perhaps there's another situation where you wanted to navigate to screen2 and have showform be true for that scenario. 

View solution in original post

4 REPLIES 4
Mike2500
Super User
Super User

Sorry, I'm not quite following your scenario, but it seems that what you've stated should work fine. In the button's onselect event, you can have UpdateContext({showform:true}), and the visible property of the form can be showform. 

i was like where to set that UpdateContext({showform:false}) initially ? is it should be hide on something ? or something like ?

You could put it in the screen's onvisible event, which would set it to false each time the user navigated to that screen. Alternatively, you could put it in the navigate function that is used to get to that screen. For example, if your form that you're hiding/showing is on screen2, and if there's a button on screen1 that navigates the user to screen2, in the button's onselect you could put:

 

Navigate(Screen2,ScreenTransition.None,{showform:false})

 

This would allow some flexibility, as perhaps there's another situation where you wanted to navigate to screen2 and have showform be true for that scenario. 

Perfect @Mike2500 . Thanks a ton.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,157)