cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Emilio
Advocate I
Advocate I

Power apps - Show/Hide Button

I'd like to create a button that when selected shows a form in the same screen (the form is very small for a tablet template).

 

Then, when the form is submitted the form shoud hide itself again.

 

Is it possible to do that?

 

Emilio Rinaudo
1 ACCEPTED SOLUTION

Accepted Solutions
hpkeong
Community Champion
Community Champion

HI

 

UpdateContext is the best syntax to trigger an action of an Object.

 

Set the Visible property of form:

- Form. Visible = vis (or any name you like as a Context Variable)

 

Insert a Button with

- Button.Onselect = UpdateContext({vis: true})        This will trigger the form to be VISIBLE

 

Then, when you submit, you press the Submit Button (or any name), and please include this at the END of the Submit function:

- SubmitButton.Onselect = Submit(Form),..........; UpdateContext({vis: false})

 

NOTE:

If you navigate from another screen, always remember to have your screen (which contains this Form and Button) written with:
- Screen.OnVisible = UpdateContext({vis: false}).

 

Reason: UpdateContext is always acting in Pair (that is true / false or false / true). Otherwise, it will sometimes not reacting.

 

Hope this helps.

 

Have a nice day.

hpkeong

View solution in original post

4 REPLIES 4
hpkeong
Community Champion
Community Champion

HI

 

UpdateContext is the best syntax to trigger an action of an Object.

 

Set the Visible property of form:

- Form. Visible = vis (or any name you like as a Context Variable)

 

Insert a Button with

- Button.Onselect = UpdateContext({vis: true})        This will trigger the form to be VISIBLE

 

Then, when you submit, you press the Submit Button (or any name), and please include this at the END of the Submit function:

- SubmitButton.Onselect = Submit(Form),..........; UpdateContext({vis: false})

 

NOTE:

If you navigate from another screen, always remember to have your screen (which contains this Form and Button) written with:
- Screen.OnVisible = UpdateContext({vis: false}).

 

Reason: UpdateContext is always acting in Pair (that is true / false or false / true). Otherwise, it will sometimes not reacting.

 

Hope this helps.

 

Have a nice day.

hpkeong

View solution in original post

v-micsh-msft
Community Support
Community Support

Hi @Emilio,

 

The steps provided by @hpkeong should work.

If you have any further questions, please post back.

Regards

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

Works Perfetctly.

Thank you!

@v-micsh-msft

@hpkeong

Emilio Rinaudo
tjowek
Frequent Visitor

Hi, 

Where should be this formula written? 

NOTE:

If you navigate from another screen, always remember to have your screen (which contains this Form and Button) written with:
- Screen.OnVisible = UpdateContext({vis: false})

 

Plan is to: Every single time when I open the "edit screen" button "send" should be hidden until form is submitted. 

The question is where to put this formula on screen?

 

EDIT:

 

Found it....

 

It should be screen and 'Onvisible'

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,079)