How to use database triggers to update full names
In this Bubble tutorial video, I'd like to demonstrate how database triggers can be really helpful when dealing with first names and last names.
Unlock the power of database triggers: Learn how to automatically update full names in Bubble!
Say goodbye to manual updates: Discover how to keep data in sync effortlessly with this Bubble tutorial.
Optimize your Bubble app: Master database triggers to streamline workflows and improve efficiency.
Introduction to Database Triggers in Bubble
In this Bubble tutorial video, I'd like to demonstrate how database triggers can be really helpful when dealing with first names and last names. I've got a repeating group here and I've got a list of contacts. I've got a first name field and a last name field. So if I was to update this first name say to Alfred, you can see that my label here updates and that's because my label is simply two dynamic values my current cell's contacts first name and my current sales contacts last name.
The Benefits of Using Database Triggers
But you might have a good reason in your app why you'd want to have the full name in your database and you could do that through workflow when you modify it but database triggers basically mean that you've got one less thing to worry about one less chance that you'll miss keeping data up to date and in sync with one another.
Setting Up Database Triggers in Bubble
So let me demonstrate to get to database triggers you need to be on a paid Bubble plan and a back in workflows enabled and we can go in and general new database trigger event and so let's say this is update full name and contacts and so what we're going to do is make changes to a thing and database triggers give you access to the data before and after this trigger occurs.
Configuring the Database Trigger
So we're going to make changes to the one after and we're going to change the field of I'll just put in full name and full name is going to be the contact after we've updated either the first name or the last name. Now you could use this contact or you could use contacts now it doesn't make any difference and we'll say first name and we will also trim this to remove any additional spaces that the user might leave after the name otherwise we'd end up with a double space in the middle. We click there we have a space of our own and we go contacts now last name and we also trimmed that.
Optimizing Workload Units
Now with regards to workload units we want to optimize this and at the moment this database trigger will run every single time anything changes with a contact and I can limit that down so I could say only when the contact before change first name is not contact now first name or contact before last name is not contact now last name. So you know my contact could have 20 other fields it could have email address it could have option set fields in there but I don't want to update full name every single time one of those fields changes I'm limiting it now just to when either first name has changed or last name has changed.
Updating the App Interface
So let me update the labels in my app so to instead say full name and refresh that. Okay so at the moment they're empty because the database trigger has not been run so maybe you'll want to consider saving it at some point depending on when your database trigger runs you might need to populate full name value first but you'll see that if I update this back to Bruce and click out my full name is populated there as Bruce Wayne I can do the same for Tony so I could put in pepper okay and the field is updated.
Important Considerations for Database Triggers
A couple of things to say about database triggers that's really worth being aware of I go back to back end. So database triggers run in the back end because they're a back end workflow. They in my experience when you run a lot of database triggers at the same time say you've imported a CSV file with a hundred entries and you're running a database trigger on each those entries in my experience it can be a little bit iffy it can fail there's definitely an element of Bubble queuing the database triggers it doesn't happen instantaneous on the front end so I'd just be aware of database triggers when you're handling large amounts of data and you're kind of pushing through so hundreds of entries in one go that all have a change like this going on I'd just be aware of that.
Limitations of Database Triggers
The other thing to mention with database triggers is that they can't trigger each other so I couldn't now add in a database trigger that says when full name changes do this action because the full name change occurs in the database trigger having said that that would run if you updated full name in a workflow elsewhere in your app what I mean is that full name the change to full name here is not going to trigger a database trigger that is looking for changes on the full name field.
Conclusion
So there you have it that is a summary and an illustration of one helpful thing that you can do and make use of database triggers if you've got any questions about database triggers do leave a comment if you've got any requests for further videos leave a comment also we look and try and respond to every single one.
Ready to Transform Your App Idea into Reality?
Access 3 courses, 400+ tutorials, and a vibrant community to support every step of your app-building journey.
Start building with total confidence
No more delays. With 30+ hours of expert content, you’ll have the insights needed to build effectively.
Find every solution in one place
No more searching across platforms for tutorials. Our bundle has everything you need, with 400+ videos covering every feature and technique.
Dive deep into every detail
Get beyond the basics with comprehensive, in-depth courses & no code tutorials that empower you to create a feature-rich, professional app.
Valued at $80
Valued at $85
Valued at $30
Valued at $110
Valued at $45
14-Day Money-Back Guarantee
We’re confident this bundle will transform your app development journey. But if you’re not satisfied within 14 days, we’ll refund your full investment—no questions asked.
Can't find what you're looking for?
Search our 300+ Bubble tutorial videos. Start learning no code today!
Frequently Asked Questions
Find answers to common questions about our courses, tutorials & content.
Not at all. Our courses are designed for beginners and guide you step-by-step in using Bubble to build powerful web apps—no coding required.
Forever. You’ll get lifetime access, so you can learn at your own pace and revisit materials anytime.
Our supportive community is here to help. Ask questions, get feedback, and learn from fellow no-coders who’ve been where you are now.
Absolutely. If you’re not satisfied within 14 days, just reach out, and we’ll issue a full refund. We stand by the value of our bundle.
Yes, this is a special limited-time offer. The regular price is $350, so take advantage of the discount while it lasts!