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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, 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!

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.

Top Solution Authors
Users online (1,757)