Forum Academy Marketplace Showcase Pricing Features

Is it possible to use ''only when" to return different data in a post API endpoint

Hi

I would like that an API end point returns A if X is true and B if it is false.

It seemed possible with the ‘only if’ feature but bubble tells me I cannot have two "return data"actions.

Is there another to achieve this ?

Many thanks!

I am afraid that is not possible. There was an earlier discussion on this and the only way to do it is to have a different API end point for each condition you want to meet.

1 Like

Thanks Ali !

In my case, I cannot really implement this option and bubble doesn’t allow two workflows on the same endpoint…

Another angle that I am thinking about is to store the answer somewhere in the database (based on conditions) and have a final action to send the answer.

But that doesn’t look very neat… I am not technical at all and I am concerned that something goes wrong when there are two simultaneous request…

Do you think this is viable ?

We’ll remove the issue when a condition is applied to the action.

3 Likes

Awesome, thanks Emmanuel !