Resetting form fields after submit and fetch collection in workflows

Hi!

I am using a Form component in WeWeb connected to Supabase. Submitting the form and inserting into the database works fine, but I am struggling to properly reset the form fields afterwards.

From what I can tell, there seems to be a difference between inputs that are bound to variables and inputs that are just fields inside the form (local data). When I reset a variable, the UI updates correctly. But when I try to reset the form’s local fields, the values may clear in the data structure but the inputs on screen do not visually reset.

Is there a recommended approach to resetting a Form component after submit, without having to convert everything into variables?

A bit off-topic, but I also noticed that using Fetch Collection inside a workflow sometimes throws errors in production, while it works fine in the editor. Is this expected, or is there a best practice for using Fetch Collection within workflows?

Thanks in advance for your help.

Hi Kappa :waving_hand:

I’d like to see an image on how your form is setup, but I can tell you already that a good practice is to bind your form inputs into a variable which is also added to the “Initial Value” so when you reset that data you are also reseting the initial text the input shows.

Hi Agustin!

Thanks for your response :slight_smile:

I’ve bound the variable to the initial value, added a workflow on the input (on change → update variable), and then on the form, after the insert, I added the “reset variable” action.

It seems to be working!

1 Like