Forum Academy Marketplace Showcase Pricing Features

Passing a List into an API call

Getting stuck on backend workflows.

Right now I set a list via a custom state and then when the list is finalized I save that to the database (I don’t think you can pass in a custom state to backend workflows).

I tested this on the page and the image below returns the correct values.

However, when I try and pass these values into openAI via backend workflows I am not getting a response (I made sure it is JSON safe).

I tried searching for the first list and tried it in the image below multiple times:

The note list is a list of notes saved as Ind-notes.

Where am I going wrong?

You can, the same way you pass the parameter values via the Schedule API workflow action, is how you pass the custom state values as the parameters.

Try testing your backend workflow with a hardcoded list value to verify if you have setup things properly or not for OpenAI to accept the format you provided. In my apps I create a data type called API fails to test why API calls fail in my backend workflows. I capture the details from the API call of error body, error message and error code (If you are not familiar with those values look into how to setup API calls using API connector and use of checkbox for capture errors)

If you can confirm your hard coded format of the list is correct and the API call doesn’t fail there, then you can start to focus on what is wrong with the way you are passing those values dynamically. If it is the dynamic expression it is likely that you are using Find & Replace operators rather than Format as Text Operator that will allow you to use proper JSON formatting for lists. If you are not familiar with the Format as Text Operator to properly structure JSON for a list, check it out on the forum there are loads of posts and I think Bubble docs cover this in detail as well, but not sure about the docs.

1 Like

Thank you! Just implemented the API fails to capture code and message. Nothing returned.

There must be an error somewhere. Let me try passing in the custom state from the front end - that would help clean up my database and limit the amount of data

Not sure how to pass in a custom state.

Just saw in my custom event I didn’t have is a list/array checked off.

Now not sure how to put that info in the note list. I’ll go to YouTube and come back if stuck.

Alright, still can’t figure it out.

I checked off is a list/array on both the custom event and in the backend API workflow.

Searched youtube, google, and twitter and tried every variation of the pic below. I feel like it should populate with the result of step 1 (create a new list).


I figured it out. Guess I have been on the computer too long. Didn’t need to pass in as list.

Maybe I didn’t have the API workflow scheduled on the custom event? Anyway, we can probably delete this thread as I doubt it’s much help to anyone.

Thanks / Sorry!