cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

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
Community Support

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
Community Support

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
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (80,686)