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

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