Mobile Form - form.setData also sets form.initialData

I'm pre-populating a form based on a selection in select box. The form is populated using the setData method. When attempting to reset the normal way it fails as initialData is now loaded with the data that was loaded with setData.

I did find a workaround. Call the setData method of the form with a single element that's in your form like this:


In this case I have a field in my form called "name" which I just set to nothing and it resets the entire form to its defaults.

Side note: I have this same form wired up pretty much identically in a web app and the reset button does work fine without the workaround, so this is likely just mobile app specific.

Hey @philone, moved this here to a mobile specific topic. Can reproduce, and will submit a bug report to the team. This was resolved for the web app form, but as you noted still exists for mobile.

Thanks Joe. I've edited my post to remove the reference to being "an old post" since it's now new :slight_smile:

1 Like