Storing dynamic text as a static text (upon expression evaluation) in a new variable

Hi fellow bubblers,

I have an interesting problem and I couldn’t find a solution for it. I am using ChatGPT API endpoint which accepts a prompt (string)

However, I would like to pass different prompt given the user’s desires. Ideally, I would have a few pre-made prompts the user chooses from. Here’s the catch: I need the prompts to be dynamic based on the user’s information (first name, product interested in, etc). This means the prompts “variable” itself relies on additional variables to construct it. This does not seem to natively work in bubble, as the dynamic portions of the prompt do not evaluate prior to outputting the prompt

My question is relatively simple: how do I store evaluated / dynamic data points (ie the variable “product” should evaluate to “solar”) as a static string upon evaluation? the string will be stored in a new fresh variable (static) which will then submit the constructed prompt to the ChatGPT API endpoint.

Thanks to all who try to help!

This topic was automatically closed after 70 days. New replies are no longer allowed.