cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anatius
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
v-micsh-msft
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
v-micsh-msft
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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,751)