cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

How to reset screen values when navigating

Hello, I have two screens, home and a form I am submiting. when I submit and go back to home and then go back to the form to make a new item, the values from the previous process are there. 

How can I reset the second screen values?

Any help or suggestions would be grate thanks

11 REPLIES 11
prajyot
Level 8

Re: How to reset screen values when navigating

Hello,
You can set the Reset property value of the textbox control to resettextbox.
On select of submit button after doing your patch or update functionlity reset the textbox values by using updatecontext.

UpdateContext({resettextbox:true}); UpdateContext({resettextbox:false}).

This will clear up the values of textbox control on second form.


Thanks & Regards,
Prajyot M

Dual Super User
Dual Super User

Re: How to reset screen values when navigating

Hi @Anonymous 

 

When you click on the button to make a new item - you would probably be setting the following

 

NewForm(formname);Navigate(screen)

 

Just add ResetForm option to this (it will reset entire form for you)

ResetForm(formname);NewForm(formname);Navigate(screen)

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Anonymous
Not applicable

Re: How to reset screen values when navigating

Thanks for the reply. Is not a form exactly. I have comboboxes, dropdown, labels and date pickers. How can I set all that to empty values, wich is what happens when I first enter the screen

Dual Super User
Dual Super User

Re: How to reset screen values when navigating

Hi @Anonymous 

 

OnVisible of that screen or on clikc of the button which navigates to that screen use

 

Reset(controlname);

 

You would have to reset each one of your controls manually

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

prajyot
Level 8

Re: How to reset screen values when navigating

The approach which I had explained earlier for specifc controls only.

 

It will work for combobox, dropdownlist, label, textbox , datetime control as well.

For every control you need to set Reset property to -resetControl and onSelect of button you have to
make it UpdateContext({resetControl:true}) , UpdateContext({resetControl:false}).

Hope this helps.


Thanks & Regards,
Prajyot M

Anonymous
Not applicable

Re: How to reset screen values when navigating

It works for everything but labels

Dual Super User
Dual Super User

Re: How to reset screen values when navigating

How are you setting text property for labels?
Anonymous
Not applicable

Re: How to reset screen values when navigating

The label is being set when gallery item is selected

Dual Super User
Dual Super User

Re: How to reset screen values when navigating

Why would a user select a gallery item when they are creating a new item?

So every time they navigate to the new form screen do they select a gallery item?

Share screenshot for clarity

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Kudoed Authors (Last 30 Days)
Users online (4,779)