OpenAI API Connector initializes successfully, but response isn't saving to my Bubble database during workflow

Hi everyone,

I’m integrating the OpenAI API (GPT-5.5 Vision) into my Bubble app using the API Connector to estimate calories from uploaded food images.

What’s working

  • Users upload an image using Bubble’s File Uploader.
  • I’m passing the uploaded image URL dynamically to the OpenAI API.
  • The API call initializes successfully in the API Connector.
  • During initialization, I receive the expected response from OpenAI.

Example response:

{
“choices”: [
{
“message”: {
“content”: “650”
}
}
]
}

Bubble detects the response correctly, and I can see the choices -> message -> content field when initializing the call.

The problem

When I use the API call inside my actual app workflow, nothing gets saved to my database.

For example, my workflow is:

  1. User uploads an image.
  2. Trigger OpenAI API call.
  3. Create/Make changes to a database thing.
  4. Set the Calories field = Result of Step X’s choices:first item's message's content.

The workflow completes without throwing an error, but the Calories field remains empty.

Things I’ve checked

  • :white_check_mark: The API initializes correctly.
  • :white_check_mark: The image URL being sent is valid and publicly accessible.
  • :white_check_mark: The API returns the expected response during initialization.
  • :white_check_mark: The database field type is text (I’ve also tried number).
  • :white_check_mark: Privacy rules are not blocking the save.

My questions

  1. Is there a difference between the initialization response and the runtime response that could cause Bubble not to populate choices:first item's message's content?
  2. Is there a known issue with nested API response fields not being available during workflows?
  3. Is there a better way to reference the response from OpenAI in Bubble?

If anyone has implemented GPT Vision or the OpenAI API in Bubble, I’d really appreciate any guidance.

Thanks! @fede.bubble @georgecollier @boston85719 @msgiblin @jesse.ethon @nick.carroll @becky.mak @lindsay.esterman @levon

Please don’t tag the entire forum in messages! It’s quite spammy

sorry about that

Try these:
The missing https: in the dynamic image URL In Bubble, when a file or image is uploaded, the dynamic link is generated starting with // (for example, //s3.amazonaws.com/``...), not https://. During your API initialization, you likely used a fully qualified URL. But during the live workflow, the OpenAI Vision API silently rejects Bubble’s dynamic URL because it strictly requires the https:// prefix. Since Bubble doesn’t stop workflows for external API errors, it just moves to the next step and saves nothing.

  • How to fix it: In your workflow Steps 2, 3, 4, and 5, click into the parameter where you pass the image URL. Manually type https: right before your dynamic expression. It should look like this: https:[Group Log meal's uploaded-image's URL].

2. The :converted to number trap (Visible in Step 7) I noticed in your screenshot that you are formatting the API result with :converted to number before saving it to the database. AI models are unpredictable. While it gave you a clean "650" during testing, in the live app, it might be returning "650 " (with a trailing space), "650 calories", or even "650\n". When Bubble tries to convert a string with spaces or letters into a number, it completely fails and leaves the field entirely blank.

  • How to fix it: Remove :converted to number and replace it with :extract with Regex. Enter [0-9]+ as the regex pattern. This acts as a filter that strips away any letters or spaces and pulls exactly the numbers from the AI’s response, making your workflow bulletproof.

    Try applying these fixes. If it still doesn’t resolve the issue, feel free to send me a direct message. I can take a look and see how I can help you get this working.

thank you

I will try this later today

Thank you very much for this explanation, i was able to get it working :raising_hands: :sweat_smile:

great to hear that

Hi @alidanial697

A minor though i think the issue is from bubble itself as this post’s creator is experiencing a similar issue

E.g on the editor, the custom state value i set is ‘please wait’ but on bubblego it stil displys the old text i was using…plus there was some conditional statements which i added on the app which hasn’t reflected on bubblego, only on web

It could be a Bubble issue. Maybe wait a few days and see if it gets resolved. If not, I’d recommend reaching out to Bubble Support—they should be able to clarify what’s going on. If you need any help, feel free to DM me.

Issue has been resolved

was actually from my end, thanks