Autobinding on normal form fields

I have a simple form elements in place, a text bind, radio buttons and drop downs etc. The user is logged in, and they have entered details on this form and press submit. The data is sent to the database and a new thing is created.

When the user refreshes this page, the form is reset, and that can’t see their most recent entry - the entry they just submitted.

How can I make it so that when the user refreshes the page, the data they just entered remains in the fields of the form - and stays there when they log out, and log back in, and also updates (then stays there).

How can I achieve this?

Hello,

Great question! By chance, do your inputs in this form have initial content? This defines what this input’s value should be when it’s reset, in this case perhaps the :last item of the newly created type. Let us know if that helps or if you have any more questions!

Hi Jess

Thanks for your reply and suggestion, and it certainly keep the ‘last item’ in the field, but it’s not editable sadly as it appears like a placeholder text. If you can let me know how I can have the last item as editable text, so the user can edit and resubmit it, you’d solve a big problem of mine!

Thanks

Hello,

Glad to hear we’re getting a bit closer! Can you let me know more about how your form is set up? From your original post, it sounds like the users are creating a new thing when clicking “Submit,” though you would also like them to be able to make changes to the same thing once that form is submitted. One option might be to resave changes to the “:last item” (example here), whereas if you are using autobinding, as soon as your user updates the input’s initial content, the corresponding field can get updated in the database (example here). Are either of these closer to what you’re looking to build?

Hi Jess

Thank you so much! I have been able to achieve this with your help after so long searching for a solution. I have 3 questions to achieve my goal in this area:

  1. I discovered autobinding previously and this might work in some use cases for me to save the user clicking the save button. When I tick autobinding, the initial content option disappears from the edit box. If this is the case, how do I achieve the initial content to be the last content shown.

  2. The last content shows as expected just fine in the fields, but this isn’t working for me for the radio buttons - in my workflow I have saved the attribute as a text, and entered XX’s value. The yes/no option also doesn’t yield any results.

  3. Is there a way to autosave a field after X seconds (a bit like autobinding, but doesn’t need the user to click out of the field)?

Many thanks for your help and support!

Hello,

Great to hear that you have been able to achieve what you are looking for! If you set the initial content and then enable autobinding, it may be possible to display the last content when the page is loaded. This is a bit confusing that the initial content field disappears, so I have also shared this with our engineering team to look into further.

In regard to the radio buttons, is it the updating of the value that doesn’t work as expected? Would it be possible to share some more details, or screenshots of that part of the setup? Also, feel free to reach out to us at support@bubble.io if you would prefer to provide the details there.

We do support a workflow event for “Do every X seconds” if that would help to save the information on a bit of a delay, in case that fits what you’re looking for.

Thanks, I have tried adding autobinding but the data within the fields disappears upon page refresh, and as I need the data to be there on moving between pages and returning to the form, this option won’t work sadly.

I have managed to get the radio buttons to work. I built a new form and they are now displaying the last selected option.

I’m all set up ready to go from here! I just have one last question - as I’m using the ‘initial content’ feature to search for the ‘last value’ and display that as way to keep the data present in the fields, is there a way to pre-populate the fields with initial content, but when user edits it, instead of the form displaying the oirignal initial content on refresh, it now displays the latest edited content. I’m aware that this will somehow be a combination of first ‘show this initially’ and then once edited ‘show the last value’.

Thanks again!

Hello,

Thanks for checking back in! Would it be possible to email our team at support@bubble.io with a link to the page where you are setting this up and some more context about the current behavior? Happy to take a closer look and make some additional recommendations.

Hello,

Just letting you know that we have pushed a fix to make it clearer what is displayed when you toggle between a dynamic initial value and autobinding.

I hope this helps!