Return Data from API Workflow returns Text incorrectly

Hi,

I have an API workflow with a ‘Return Data from API’ action which returns a Key (parameter) of an specific data type.

I am trying to assign the returned data object into a custom state (of the same type) but I am getting an error that the returned data is a Text even though I haven’t ticked the ‘Return a plan Text’ box.

any ideas or samples on a similar implementation of this action?

thanks

3 Likes

Can you share a screenshot? The bug is that you should not be able to use a return data from API action on a page, so using a ‘set state’ action after does not make sense.

Here is the ‘Return Data from API’ action…

and here is the screenshot when trying to set a custom state of the returned API call within a WF.

Right, if you look at the second screenshot you’ll see the step 1 is ‘schedule API…’ which returns a scheduled ID, not the data returned by the API Endpoint

1 Like

Is there a way to check if the Scheduled API ran successfully WITHOUT having to check the Thing that was updated by that Scheduled WF?

In brief here is my scenario…

I’m building a POS system that lists all pending Orders in a queue (RG). It is taking approx 3secs for an Order to be picked up from the queue (updated as being served and saved into a Custom State for serving) and reflected across all screens, 3 seconds is far too long and there is a risk that 2 people may pick-up the same order.

The Scheduled API has a 3 secs delay to “verify” (ensure that it hasn’t been picked-up already) and proceed to copy order into a Custom State for fulfilling.

@Rogelio Did you ever sort this out? Having the same/similar problem.

They really need to allows the backend workflow to return values back to the client… Still doesn’t work.

What you have to do is add it to your API Connector plugin so your app essentially calls itself, then that would return values. In your app settings you have to generate an API key for your calls to authenticate

1 Like

Thanks Tyler. Seems like a basic, simple and necessary thing to add – surprising it’s not there after all this time.

Related to this, do you know if it’s possible to pass IN parameter values to a DATA call for an external API (like when trying call it from a condition, for example)?

Thanks!

M

Yes it seems like a very essential thing that should be implemented…

I’ve seen it too on the Bubble Ideaboard.

And yea as long as you have the key/parameters “Private” unchecked it should show up as a field to insert data when you want to retrieve data.

1 Like

Agreed! Perhaps it’s time to start a petition to truly bubble this up…

On the data call, Private is unchecked, but I don’t see a way through the UI to set input parameters. Maybe I’m unaware of the basic mechanism for how to do this for external data API calls?..

My bad…I just figured this out :slight_smile (on the data call): Got it! Thanks for your help.

FWIW, @tylerboodman, what I’m talking about there is making the client-side Actions plugin API like the server-side Actions plugin API (which can return values while client-side Actions cannot, at present).

However, it’s true that the Return Data from API backend workflow action is only for one’s app’s exposed API endpoints. And you can, in fact, get the behavior of returning data from the backend in this way, if you set up an API connection to your own app’s API. (I know this seems weird and non-intuitive, but one can in fact do this. I’ve talked about this before in older videos and touch on it in this more recent video).

1 Like

Thanks for clarifying @keith and the sending me in the right direction @tylerboodman . Much appreciated.

I will give this a try very soon.

Maybe do you mean to make your API call as an action in the workflow?

Changing to that makes it so you can pick it as an action and insert values