How to read result from backend workflow

Hello everyone!

It might be a silly question. Sorry. But how can i retrieve the result of my backend workflow?

When i press a button, i send some parameters to my backend workflow so it can process some information. So, after all the math, how can i read the result of this backend process?

I am new in Bubble but as far as i know, the backend workflow`s result is always a JSON, am i right?

I tryed to do a REALY simple thing as shown below: trigger a backend workflow to show the “Current user`s name”… But i cant read the result.

What am i missing here? :sweat_smile:

Think of an endpoint like if it was a function.

It can take inputs (or not). Those can be brought via parameters that you set or new ones can be done vía SCRUD (search, create, update, delete) functionality that you structure within the flow.

So, in your use case you need to determine what comes next after the action you are showing.

From where do you call this endpoint?

1 Like

Thanks for the reply @cmarchan and @Jici !

I think my lack of expertise is the problem :rofl:

  1. I have a button that calls a Backend Workflow (without parameters)
  2. In this Backend Workflow i want to get the “Current User`s Name” (or any other information)

So, in my main workflow, just after my button calls this Backend Workflow event, how can i get this information (Current user`s name) that was generated in the Backend? Is it possible to illustrate it for me in some application? Or with images?

@rpetribu

If you want to send the browser’s current user data to the backend endpoint then create a parameter of type user in the endpoint and when you click the button schedule the flow and send the current user in that user parameter.

If you just scheduled the backend flow upon a click then just place a display element on the page and run a search to find it. The display elements can be a text element, a group, a repeating group, etc.

1 Like

You don’t need to use backend WF for that. Not sure what you expect exacly to do with this endpoint. Return Data from API it’s more to use from an third party tool.

The reason is that this specific action will be trigger in and outside my application. So i decided to create this endpoint to have this operation written only in one place. And i am expecting to read it from outside and from inside.

I have no problem to get the result from outside… The problem is to read it inside Bubble…

Get the “Current User`s Name” was an example. I am trying to read anything from the endpoint.

This guy is having the same issue as me:

I have a button to trigger the Backend workflow as below:

In this Backend workflow i have only this:

I was trying to get the message “This is a test text” in my main flow… but i keep recieving numbers…

Thats make no sense for me…

2 Likes

REally not sure exactly what you expect. Normally, you don’t call data usimg a Backend WF.
If you really wan’t to do this, use API Connector and call your own API Backend WF (Using a Post request).

2 Likes

The text is apparently the n# of the workflow schedule, bit not the actual result. And yes, I am clueless about why we cannot read the data from within Bubble either. I also contacted support but couldn’t get a clear answer on this. I had to really work around via the database to store my data instead, for something as silly as generating a concatenated string.

@emmanuel is there someone at Bubble who can shed light on the usage of this return data from API feature and how to use it? Why can’t we get the data, back to the front-end?

1 Like

Like I said earlier, this exist to be use from an external third party tool (real API Call).
If you call this endpoint using API Connector, you will be able to read the data returned.
But there’s absolutely no reason to use a Backend WF from Frontend to get data. All tools already exist to get data from the “frontend”.

1 Like

Hi @rpetribu and @umiumansa – did you have any luck figuring this out?

Bubble’s manual says this is doable, but like you I can’t figure out how it works yet…

https://manual.bubble.io/help-guides/the-bubble-api/defining-the-api#returning-data-from-the-api-workflow

2 Likes

No progress.

Nothing… i gave up. :sweat_smile:

Thanks @rpetribu and @umiumansa . I am going to send in a note to bubble support and see if they can provide instructions.

In my case, the use case is trying to execute a list-to-list search server side. Right now, such a search can only be executed client side via an advanced filter, which isn’t scalable.

As @Jici said, simply expose your API endpoint as a public endpoint and call it from the API connector plugin. You can then get the results as if you would call a 3rd party API.

3 Likes

Thank you. I think the issue is for that those (like me) that are not yet API conversant, we are wondering if there is a way to pull the data from a backend workflow without having to treat your own app as an external app you need to call from. If there is absolutely no other way to get data from a backend workflow then so be it, but I’m still not clear on whether it’s possible via Bubble’s regular backend and regular worfklow screens.

1 Like

@ed727

These videos by @evanlitttle are pretty straightforward and shorter than the Bubble webinars

There is also a bunch of very knowledgeable folks @neilpierce @mariel.vargas that are cranking up a new community/service to learn and obtain support on apis and Bubble > https://nocodeapis.com/

3 Likes

@ed727

Calling functions (endpoints) within an app is not an uncommon practice.

Thanks for this and the video. Yes, I need to take the plunge at some point and learn all the API stuff…

Hi, received a helpful response from Bubble support. In short, you can’t get data from the backend workflow using “Return data from API” step. Further, if you are looking to retrieve and display data, you can’t use a backend workflow for that (need to use a API call from the front end, as posters here have noted).

To really understand the API stuff, I need to spend some serious time on the videos/documents and then do all the experimenting to see how it works in practice. I’ll post back any insights if/when I get through that process.

4 Likes