Bubble.io Beginners - How to edit a database entry
In this Bubble beginner tutorial we explain how to use a popup and form to make changes to an entry in your Bubble.io database.
Master database editing: Learn how to effortlessly edit data in your Bubble app using the 'make changes to thing' workflow action.
Unlock the power of pop-ups: Discover how to create dynamic forms for editing custom events in your Bubble database with just a few clicks.
Streamline your workflow: See how to populate forms with existing data and save changes seamlessly in your Bubble app.
Editing Database Entries in Bubble
Now that I've got entries in my Bubble database, how do I edit them? In this Bubble tutorial I'm going to demonstrate to you how we can use the make changes to thing workflow action to edit the contacts in our database. So I'm going to go back into the editor and I've got my table set up here and I'm going to edit by using a pop-up and this is just one way that you can edit. You basically get to a point where you're displaying a form in order to edit data in your Bubble app.
Setting Up the Edit Form
So that's having a pop-up and I'm going to make this a column, add in a little bit of padding. I'm going to make the design quite rough because it's not what I'm wanting to focus on in this video. So I'm going to add in a field and we'll call this first name and copy and paste it last name and then I actually think that country is an option set. Let me check on my contacts. Note country is just a regular text field. Fine. Let's just copy and paste this one then and say country I'm going to add in a little bit of a gap to make it all neat and last thing we need is the button which they say changes.
Configuring the Pop-up
So there are a few extra things we need to set up. One is when a user clicks on the contact they want to edit, we need to bring up this form and it makes sense that this form is then populated with previous data and then that data can be changed and they'll say those changes saved. So to do that, I'm going to set the type of content here to contact but leave the data source blank. That's because I'm going to set up so that when the first name label is clicked instead of go to page that's from a different tutorial. I am going to show the pop-up and I'm going to display data in that pop-up of current rows contacts.
Populating the Form Fields
So that then means that the pop-up has available to itself the contact that's been parsed into it through clicking on the contact in the table element. So now on my fields I can set initial contact initial content and so I can say parent groups because that's the pop-up contacts first name initial content parent groups last name and initial content country. Let's test that. So if I click on Bruce and then get Bruce's details ready for me to say changes, let's set up the save changes button now.
Setting Up the Save Changes Workflow
So I'm going to add a workflow and that takes us into the workflow tab and it sets up a workflow ready for that action or save changes button is clicked. So then I make changes to a thing and that's going to be parent groups contacts. Again the contact that we've passed in to the pop-up and then I select all the fields that I want to make changes to and I match up those fields. Now a temptation here is to think oh I should be using this contact. Note this contact refers to the contact that's been passed into it. So if you were to use this contact you wouldn't be looking to the new data in the input fields. You're in fact just overwriting previous data with identical previous data. So we want to make sure that we're linked in with our inputs. And then this is a input last name and input country.
Finalizing the Workflow
Okay, now this is the part where where I often forget what is logically the next step. You've got to show, you know, you've got to hide the pop-up. Otherwise you're stuck on the form and you don't know whether it's being completed or not. So let's go for pepper and let's say we change this to pots. And we save changes and you can see pots is updated. We're clicking it again, change it back to stark and it's been updated.
Conclusion and Further Resources
If you're learning Bubble, we've got hundreds of Bubble To Thrower videos available. Some of them are on YouTube but you'll find many more on our website planetnocode.com where we've got videos exclusive to our members and if you're serious about learning Bubble and you're enjoying this video format, I thoroughly recommend you check out our website, plantnoco.com.
Can't find what you're looking for?
Search our 300+ Bubble tutorial videos. Start learning no code today!
3 ways we support solopreneurs
Our team is here to help, with a combined 30+ years working for internet startips.
Learn Bubble
Explore our library of 300+ Bubble and no code tutorial videos. Watched by over 800k no coders on YouTube.
Bubble Coaching
Troubleshoot your Bubble app and build new no code features with our in house Bubble expert.
Mastery
Ready to take your SaaS idea to the next level? Join our exclusive Mastery program for personalised content & mentoring.