Issues with the API connector using default vaules

Hey everyone,

Today, I had the pleasure of spending a considerable amount of time troubleshooting an interesting (read: frustrating) behaviour in our Bubble application. I thought I’d share my findings, both as a cautionary tale and to see if anyone else has encountered something similar.

Here’s what I observed:

  • I have a frontend workflow that schedules a backend workflow, passing a text parameter as part of the process.
  • The backend workflow then makes an API call using that text parameter, as set up earlier in the API connector.
  • Now, here’s the fun part: when the text from the frontend is empty, the API call still goes through – but instead of using an empty value, it magically defaults to the value used during initialization. Naturally, this means the workflow finishes successfully instead of logging an error, which is, of course, extremely helpful when trying to identify the problem.

I’ve managed to resolve this by setting that parameter to use a “defaulting to” fallback, which is admittedly an improvement over using the initialization value. However, it still feels less than ideal.

This little adventure in debugging was, let’s just say, an absolute delight. I’m honestly curious – has anyone else experienced this behaviour? Am I being overly particular here, or is this just another quirk of the Bubble API Connector that we should all be mildly annoyed about?

Looking forward to hearing your thoughts

I ran into the same issue in a POST request to my own application lately.

The problem was, that I didn’t mark the body parameter with the ‘Allow blank’ checkmark (spent quite some time wondering, why it didn’t work as the request didn’t throw an error defaulting back to the value setup in the Request setup).

After I put the ‘Allow blank’ checkmark when passing empty values, the workflow correctly received an empty value.

Did you set that checkmark correctly?

1 Like

I totally agree with your solution, and I actually didn’t know about that approach before – so thanks for sharing! :slight_smile:

In my case, I’m trying to set the “from” email (sender), as you can see from the screenshot, this value just can’t be empty. I know that the proper way to ensure that is by validating the input on the frontend and showing an error to the user before scheduling the backend workflow.

But honestly, it would have been so much easier to find the issue (where it is coming from) if Bubble just threw an error in the backend rather than quietly using the initialization value.

Yeah, logs really aren’t doing what they’re supposed to. Had major headaches over the weekend because of data not being written although log’s confirmed that they are – was really loosing my mind. Tips topic following soon…