OpenAI API "list" of input

Hi Bubble, I have an OpenAI API call, in the prompt I specify that it will determine some number base on a list of “Submission”, which is a data type I have set up in bubble, each Submission contains a list of fields: A(text), B(number), C(list of text), D(list of file)
I have no problem setting it up with just one “submission” with the dynamic input prompt: < A> < B> < C> < D>.

I tried specify the “submission” in the API prompt along with < A> < B> < C> < D>, but it can’t refer to the whole submission object; I tried scheduled API on a list but it triggers one object (one set of < A> < B> < C> < D>) each time and give a response, the desire outcome is input a list of object that gives one response.

I have also thought of setting up a backend workflow that convert a submission object into a line of text like a json, but the problem is < D> is a list of file.

Thank you.

From what I understand, you’re trying to send a list of Things (in your case, a Permission) to an API service. Is that correct?

There’s a few ways to do this, but you need to make sure that the privacy rules for your data type (Thing) Permission allow for this.

One way that I like to do this is to make an expression that uses the :format as text operator. For example,

Do a search for Permissions:format as text

This will allow you to define some text for each item. What you can do is:

{ "field1": "value1", // Add any values you want here }

And make sure to choose “,” as the delimiter.

This returns a list of JSON objects (if you did it right). You can now include this in your request body.

Important : Do not open the rich text editor when doing this. It completely breaks the JSON formatting for some reason, even if you make no changes.

Good luck :crossed_fingers:

1 Like

Thanks Jonah for your reply, I found a workaround, create a group that has a button trigger the API call and a hidden repeating group, input for that API call would be Repeating Group’s list of xxx each item’s yyy and click “insert dynamic data” to add another yyy if needed

xxx would be submission in my case
yyy would be < A >, < B >, < C >, < D > in my case

Lastly, hide and collapse that repeating, only leave the button visible,
lock the entire button-RG group

there you go, BAAAAMMMM!