Forum Academy Marketplace Showcase Pricing Features

Let us return values from custom events

Custom events are really cool, but they lack the ability to return values (like a custom state on an element)

CONTEXT

I am manually authenticating API requests to an API workflow in the backend. What I would like to do is create a custom event called “Authenticate” which would return a “yes” or “no” value depending on if the API request meets the authentication requirements I have defined. Based on the result of the event, I want to either reject the workflow or to run the rest of the actions.

THE PROBLEM

there is no way to return values from custom events. Instead, you must do the following:

  1. API workflow runs custom event (let’s called it custom_event_1)
  2. Inside custom_event_1 you run the authentication process, then if everything works out you then run a new custom event (custom_event_2)
  3. Inside custom_event_2 you run the actual actions you wanted to take in the original API workflow

A BETTER WAY (REDUCE REUSE RECYCLE)

A way better way of doing this executing actions depending on the returned values from the custom event. This would let users reuse their custom events (in my case, authentication process) for all of their front and backend workflows by leveraging parameters and return values.

Right now I can’t reuse this custom event, because I had to hard code custom_event_2 inside custom_event_1

I want to run the same authentication workflow for ALL my webhooks. Now, I need to create several custom events that all do the same thing …

Let me know what you guys think

11 Likes

How about use endpoints?
Then you bring return values back into play.

I do exactly that with a single endpoint that returns the User.

I do also agree that return values on custom events (esp. front end) and in several other parts of Bubble (f/e plug-in actions!) would be v useful though

2 Likes

It’s interesting, using endpoints, I’m sure that works for you but it just seems like a weird workaround that shouldn’t exist. Not to mention, super inefficient!

Bubble already treats workflows like “functions”, so I don’t see why functions shouldn’t be able to “return” something

3 Likes

Yeah, Bubble is dumb.

2 Likes

Hey, @grace.hong can you share light on this matter? It’s actually a super useful thing to have.

2 Likes

+1 to this

1 Like

Agreed

1 Like

+1 to this

2 Likes

wow no joke

1 Like

Was this implemented? seems like there is an option to return data from the api in custom event workflows but I still just get { status: "success" }