[New Feature] Return data on custom events

Hi everyone!

I’m Grace, a Product Manager at Bubble. We are excited to release the ability to return data from custom events, which allows your workflows to now send multiple types of usable data between each other. We love it when you build modular apps that scale to millions of customers, and this feature will make it easier for you to do so.

How it works

Custom events are powerful ways to reuse the same logic in more than one workflow to build more modularly and efficiently.

For example, if you’re taking payments in your app, you can create a custom “authorization” event in your payment workflows that checks whether a user’s credit card can be charged. With this new feature, you can return a yes/no value for whether the user is authorized to be charged and an optional text value for an error message. Then you can use those values in a new workflow that either 1) charges the user’s credit card if they’re authorized OR 2) sends the user an “error” email if the authorization fails to remind them to resolve the issue.

Using this feature, you can:

  • Reduce the number of custom events in your app: Use a single event to return different values, instead of multiple custom events with slight variations
  • Build more modularly and resourcefully: Edit ‌reusable custom events in one place, rather than multiple
  • Understand your app better: View one custom event, rather than multiple custom events with slight variations

This also means that your reusable elements can now hold global functions! We’re not stopping here. This new upgrade to custom events allows your workflows to act even more similar to traditional programming “functions,” laying the groundwork for even more ways to make Bubble on par with custom code.

Read more on how to use returning data from custom events in our manual.

Every Ideaboard submission:

Related forum posts:

66 Likes

Christmas presents in the end of January? I like it :slight_smile:

7 Likes

Well… this really is a big update… I’m looking forward to playing with this :slight_smile:

6 Likes

YOU ARE AWESOME!!!

Thanks so much for this.

2 Likes

It finally happened :tada: :tada: Thank you!

This will definitely add quite a lot of of clean-up work to remove all the workarounds we had to use.

3 Likes

THAT is a real improvement!

2 Likes

Time to get a cake to celebrate :tada:

1 Like

wOW !! As I posted the “Return data from API internally” idea (in november 2020 in France we say “mieux vaut tard que jamais” (better late than never) I just get notified by email, and didn’t believe it until I read the post! Can’t wait to integrate it !! Nice news @grace.hong :partying_face:

[EDIT] not expected behavior lol. need to “schedule an API workflow” in front and be able to use “Result of step xx” response in front…

7 Likes

I love that while keeping a nocode philosophy, you guys are solving more and more the “my, this would be easier with code” moments.

It’s really really great, I love where Bubble’s going for 2024 !

2 Likes

This is huge! Glad to see it released so early in the year!

Btw - my ideaboard post above (events being triggered in a reusable element that can be listened…isn’t actually solved by this.

Returning data is amazing but my post was about being able to set up a workflow to run on some event being ‘posted’ by a reusable (without using hacky workarounds like listening to a custom state being changed). We still need this :slight_smile:

Top work on this release though and keep em coming!

6 Likes

:fire:
:smiley:
:+1:

Awesome!

Great!

@grace.hong any chance there will be a new Workflow trigger event introduced that would be something akin to ‘custom event returned data’ (the returned being past tense as in completed), which will allow us to not only use the returned data in the same workflow, but in another workflow that is created via this concept of a workflow trigger event of ‘custom event returned data’. Similar to how there are in many plugins a workflow trigger event for when some kind of processing of data has completed.

3 Likes

This is awesome!!! Thanks @grace.hong and bubble team can’t wait to try it!

1 Like

I was also very excited when the email notify that your idea was shipped, but then after checking, it was not it. I think the Bubble team doesn’t understand your idea.

The idea in question: Return data from API internally

What @Sarah_Esteve meant in the idea was for a way to use the return value of API workflow when you run that API workflow inside the application.

This new feature only applies to Custom Events, not API workflow (yet?)

To be honest, the idea is not implemented, but very close. If we can have a way to: on the Frontend, trigger Custom Event on the Backend, we will get what we came for.

7 Likes

Probably the most important feature released in months! It will undoubtedly radically change the way in which we will now build the logic of our apps.
:star_struck: :raised_hands:

You can do it already!
Use the API connector to call your API Workflow (which can call a custom event when needed).

2 Likes

Major major improvement! :rocket::rocket::rocket::rocket::rocket::rocket:

Yup, that was what I used.
Also my friend found out another trick, which is to use App Connector Plugin to connect the app to itself. This way you don’t even need to initialize the API call.

Would be nice if there is some official way to do it though.

3 Likes

In the op it mentions you can now have global functions via custom workflows in re useable elements. However in the manual it says the trigger custom event from a RE is only one way.

Am I reading wrong?