How to display API Connector response text in a text element - can't find Result of Step 1

Hi everyone,

I'm building my first Bubble app and have successfully set up an API Connector call to OpenAI that's working (I see status 200 in Network tab).

I'm trying to display the text response from the API call in a Text element on my page.

**What I've done:**
1. Created API call in API Connector (OpenAI - Generate_KPIs)
2. Added the API action to a button workflow (Step 1)
3. Added a Text element to display the response
4. Clicked "Insert dynamic data" on the text element
5. Selected "Text Result of Step 1"

**The problem:**
After selecting "Text Result of Step 1", Bubble does not provide an option to show the actual text result from step 1

I just want to display the text response from the API call.

**Questions:**
- How do I properly display the API response text.
- Is there a different way to access the API response content?
- Should I be looking for a different field like "message content" or similar?

Any help appreciated.

You’re trying to display the raw JSON object. After ‘Result of Step 1’, you need to navigate to the specific key holding the text, like ‘choices:first item:message:content’.

Hey! @dvanes8 You’re very close. The reason you’re not seeing the actual text is usually because the API call response isn’t fully defined in the API Connector. Even though you’re getting a 200, Bubble doesn’t know which part of the response is “the text” unless you tell it.

Make sure the call is set to Use as: Action, then open the API Connector and check the Response section. You need to initialize the call and explicitly define the field that contains the text (for OpenAI this is often something like choices → first item → message → content or similar, depending on the endpoint). Once that field exists, it will show up as a selectable value, not just “Text result”.

A very common pattern is to save the API response into a custom state or a database field in the workflow, then bind your Text element to that state/field. That avoids relying directly on “Result of step 1” and makes debugging much easier.

So short answer is to define the response fields in the API Connector, then reference that specific field, or store it first. Once you do that, the text will display correctly.

Hi Hassaan

Thank you for your encouragement and taking the time to give me this detailed answer - I appreciate it!!

1 Like

HiBaloshi68

Thanks for the advice - u may have saved me a ton of time!

I have a button with a workflow that calls an API Connector action (OpenAI - Generate_KPIs). The workflow runs successfully (status 200 in Network tab).

I’m trying to display the API response in a Text element on the same page, but when I click “Insert dynamic data” on the text element, I don’t see “Result of Step 1” as an option in the data selector.

Both the button and text element are on the same page (setup-kpis). The workflow has Step 1: OpenAI - Generate_KPIs with the job_description parameter set.

How do I access the workflow result to display it in a text element?

Screenshots attached showing:

  • The workflow with the API action
  • The data selector (no Result of Step 1 option)
  • The API Connector configuration

Sir, you dont see Result of Step 1 in display in mini editore for specific element , here you can only see elemenmt availbe within page.

you have to call another action after your OpenAI - Generate KPIs you can user display date to group of popup and then pass the resutl of step 1 there.

then inside your editor you have reference that gruop or its custom state to show the result.

if you like walk you through how do it, ping me when you available and we can do it togather.

Bubble receives a JSON object, not plain text.
That’s why you need to reference the correct field inside the response, or store it first and then display it.

I see that you’re trying to generate a JSON from the LLM response. The LLM will ultimately return the JSON inside a string, so you won’t be able to directly access the JSON values from the response. What you need to do is create an API workflow that reads this JSON and returns it formatted in your API Connector.

So, in your backend workflows, create an API workflow called parse-json, or read-json, something like that. I grabbed one of my apps here to show as an example:

Then, in your API Connector, you can have an API just for Bubble calls, or something like that. For example, in this app, I had this API only for reading these JSONs. So create your call in the API Connector pointing to the API workflow you created:

With that, the result of this call will be the JSON body of the LLM response.

Regarding this whole JSON parsing topic, I see that a lot of people get confused. I always recommend this post:

There you’ll be able to see this JSON reading structure much better than I explained above.

After you get this working, your workflow will be more or less like this:

  1. OpenAI - Generate_KPI’s
  2. Call to parse the JSON
  3. You can have a custom states where you insert whatever value you want after the result of step 2. Because the result of step 2 will be the category, description, and target values, just like you asked for in your AI prompt. Or you can even go a step further and already create the item in the database and then display that item, or something along those lines.
1 Like

Thanks for sharing the link! Glad it’s helpful!