Adding toggle-choices to a prompt

Hi! I’m creating an app that uses OpenAI. I’m trying to achieve the following:

The user selects the desired options using toggles, writes their text, and clicks send. Then, both the text and the information about the selected options are sent to OpenAI.

But I don’t understand how to get the toggle on/off options into my prompt.

How are you expecting to get the on/off options into your prompt?

As an appended text at the end of the written text?

Yes, that could work. Or maybe get the options into the “body parameter” of my API-call…
Does that make sense?

I guess that adding the toggled text in the backstage is cleaner UI-wise. That truly depends on how you want to do it.

What have you tried so far?

So far I’ve only tried to add the toggled choices to a the database record (I’m making a new db record for each clicked ‘send’): But I obviously don’t know what I’m doing… I’m really quite new to Bubble. How would you add the toggled text to the backstage? With the backend workflows?

You just need to pass dynamic values to the API call.

In your case, the text associated to cards whose switch is set to true when the Send button is clicked.

I guess you are doing something similar with the text the user writes in the input box.

I have a workflow that when “send” is clicked a new thing is created (a new record in the question database) with the users question as the only field.

And then I have a backend workflow that calls the api and makes the promt with the question from the db

I can not seem to understand how I can get the situation of checked og not-checked toggles to input some instructions in the call.

…and all the choices with a toggle is a repeating group showing from a db.