Forum Academy Marketplace Showcase Pricing Features

[Public Beta] Database change triggers

Hey all,

I’m excited to announce that database change triggers are open for public beta testing. They are available on (non-legacy) Person plans and above. If your app is eligible for them, then on the Backend workflows page, you will see:

database trigger

Special thanks to @anna4, who built out the core of the feature during an internship with us this winter! And thank you to everyone who helped with alpha testing.

Database triggers allow triggering backend workflows when data in your app is modified according to rules you express in the “Only when…” condition. Use cases include:

  • Triggering a workflow when you modify data in the Data panel of the editor
  • Triggering a workflow when you modify data via the Data API
  • Centralizing logic that should happen whenever a certain type of modification is made, to avoid having to manually add a “Schedule API workflow” action in every single workflow in your app that touches that data

I’m particularly excited about that last use case. Lots of apps we see have complicated logic where 20 or 30 workflows are all triggering the same API workflow, because they all need to share logic. Using change trigger workflows, you can make your app a lot simpler and easier to maintain by deleting all those actions.

This feature is in public beta, which means that while we’ve tested it in real apps, do expect to see bugs that have slipped through our testing. Test carefully before depending on it for a mission critical use case. As always, please report bugs here: https://bubble.io/bug_report

There are a number of details, caveats and limitations, so I recommend reading the full documentation before using it: https://bubble.io/reference#Events.DatabaseTriggerEvent

Thanks!!

58 Likes

Thank you @anna4 & @josh :fire::fire::fire::fire::fire::fire:

Very Excited! Thanks Bubble!

Is this to say we can implement Excel like functionality? Say I have a simple shopping cart example… if the quantity in cart changes, then trigger this workflow to update the total price to equal the new quantity * price?

… but also it could be way more complicated than that.?. like I could instead trigger an API call that does a really fancy computation for me and returns the result to be saved to the database… all from the backend?

This is AMAZING!

1 Like

I guess it depends on how fast the database accepts and processes the data. If someone changes cart items super quick, will it get confused?

Great news. One thing @josh you might want to look adding some paragraph breaks to the manual text :smile: Just to make it more UI friendly!

4 Likes

Love this feature, @josh! Tons of use cases for it and have been experimenting.

A tip for anyone who may not know about it (or forgot about it), use the App Search tool to go through any endpoint you want to convert to a trigger and find each place in your app where you are scheduling that endpoint.

8 Likes

Agreed, this feature is proving super handy and the fact we can reference both the old and new version of the data entry is really useful. Great job guys on this one.

Probably a good call with the rename btw:
image

Cheers

2 Likes

Just wanna ask a question, is this good for making some "acitivity log? system? like, when a data is changed, trigger “create new activity log”

2 Likes

@shu.teopengco The short answer is yes, this would make the perfect companion to achieve such a feature like an activity, notification or change log system.

3 Likes

Just tried to use it but it doesn’t involve legacy plans. :frowning:

1 Like

Hello

I was wondering if someone could answer my question on a use case.

I have a user thing with nested things inside

So when it comes to downloading the data into one CSV file, what I do is I keep a mirrored thing and I update that with workflows everytime something is changed. Hope your with me.

I’ve been wondering if this Database change trigger is a good use case for above instead of using workflows every time I change a dropdown? I’ve been trying to work out how to use it but I’m struggling a little bit.

Any advice would be great.

Cheers

Great. Thank you @josh

This is an amazing and excellent feature which saves a lot of flows and condition of logic running in parallel sometimes we can get very easily lost, thank you.

A small & useful upgrade would be to output a difference between the new thing and the existing thing. This would be really powerful for audit logging.

Finally a selective ‘do not fire change’ check box since there will be workflows running where you do not want it to trigger a database update.

2 Likes

I was trying the same thing and realized All the accounts I have are on legacy plans, seems loyalty is not something Bubble values. :angry:

2 Likes

That’s so disappointing

2 Likes

Indeed. @josh are there any plans to launch this on ALL plans, including legacy?

4 Likes

It’s a bit dirty to exclude features from legacy plans.

It removes the benefit of the legacy plans, forces the upgrade and in my opinion is like a middle finger to the earliest adopters.

Is Bubble still great value for money… yes! But it reduces my confidence in how they will treat users in the future.

3 Likes

I’d have to dis agree that it’s value for money most other platforms out there charge by user not by app