cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anatius
Level: Powered On

Form field reset for a field that is not directly connected to data source

Hi,

 

I have added a custom data card to a form, to collect comments that are appended to a "master comments field" in the datasource. This custom field ("CommentsEdit") is just a regular text input, with no connection to data source. I have added the custom data card inside the form the avoid layout issues that occurred when it was outside the form.

 

The problem: Once a user has used this field to add a comment to a case, and opens the same form again for another item, it contains the comment from the past item. I am not able to trigger the reset function from the submit button, since ("reset must be triggered from within the form") and reset on form's onSuccess results in a similar error message (cannot be applied to input field in a form, apparently).

 

Any ideas? How to reset a text input in a form, when field is not connected to a data source?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Form field reset for a field that is not directly connected to data source

You should be able to reset the control within a Form control by the ResetForm() function.

 

Besides, instead of the ReSetForm() function, you could also try to use Variable to Reset the control within the form.

 

For example, under the Reset Property of the related control, configure a variable name:

ResetVariable

 

Then under the submit Button, add the code below:

UpdateContext({ResetVariable:true});UpdateContext({ResetVariable:false})

Doing it in this way should be able to have the control reset to its default value.

 

Regards,

Michael

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.

View solution in original post

1 REPLY 1
Community Support Team
Community Support Team

Re: Form field reset for a field that is not directly connected to data source

You should be able to reset the control within a Form control by the ResetForm() function.

 

Besides, instead of the ReSetForm() function, you could also try to use Variable to Reset the control within the form.

 

For example, under the Reset Property of the related control, configure a variable name:

ResetVariable

 

Then under the submit Button, add the code below:

UpdateContext({ResetVariable:true});UpdateContext({ResetVariable:false})

Doing it in this way should be able to have the control reset to its default value.

 

Regards,

Michael

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.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

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 Solution Authors
Top Kudoed Authors
Users online (4,488)