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

Do not clear text inputs on form afer submit

Guys, I need a little help in here.

 

I have a form with a list and there is 10 items the user will choose one by one and submit.

 

But he need to fill another infos before also, and for User Experience, after the SubmitForm, I want that those fields remain the same so he can keep submitting and only change the listitems.

 

But when i submit, the entire form is reseted, I tested with many ways (newform, editform), I have only SubmitForm and it still clear all the inputs.

 

4 REPLIES 4
v-yutliu-msft
Level 10

Re: Do not clear text inputs on form afer submit

Hi @Anonymous ,

Do you want to use the value in the TextInput control after submitting the form?

I’ve made a similar test , you could refer this:

1、Set the forms DefaultMode: New

2、Set the form’s Items: {clumn name:If(IsBlank(variable name),"",variable name)}

3Set the submit Button’s OnSelect: Set(variable name,DataCardValue1.Text);SubmitForm(Form1)

After these settings, the value in the TextInput will not be cleared after submitting the form.

 

 

Best regards,

Community Support Team _ Phoebe Liu

 

 

 

 

 

Best regards,

Phoebe

Anonymous
Not applicable

Re: Do not clear text inputs on form afer submit

humm okay i will give it a try.

 

But I have around 10 columns on the form, I will have to create the variable for each column.....

and also I have another 3 forms hahahah

 

if there is a easer way Smiley Sad

 

but thanks for the reply, i will definitly try it now.

 

 

Highlighted
Anonymous
Not applicable

Re: Do not clear text inputs on form afer submit

Actually i want that, when the user submit the form, the values in the textinputs does not disappear so they can change only a single item on the form and then submit again with the same informations on the others textinputs.

 

it is something similar to this, when inputing, the values on the form does not disappear.

/t5/image/serverpage/image-id/33330i6073249DDF6C424F/image-size/large?v=1.0&px=999

https://powerusers.microsoft.com/t5/General-Discussion/Avoid-clearing-the-data-in-form-after-submitt...

But i tried with no success Smiley Sad

 

Super User
Super User

Re: Do not clear text inputs on form afer submit

@Anonymous 

Are you using a SubmitForm to submit or are you patching manually?

 

If you are using SubmitForm, then you might consider this process, rather than to create a variable for every field, just capture the last submit.

So, for your button (or wherever you are using the SubmitForm function), consider this formula:

SubmitForm(yourForm);
UpdateContext({lastInfo: yourForm.LastSubmit});
NewForm(yourForm)

Then, in the Default values of the DataCards on the form, change them all to the following (obviously observing the names of each column for the data card):

If(IsBlank(lastInfo.yourColumnName), ThisItem.yourColumnName, lastInfo.yourColumnName)

That should give you all the same values of the last submitted form for all the fields.  If you have a lot of fields, it will be a pain to do them all, but at least you're only working with one variable then instead of one for each.  

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.