How to combine multiple database entries into a single entry

Hi everyone,

I am building a long-form article writer in Bubble using the GPT API.

I am able to get around 500-800 words returned from the GPT API until I hit the output token limit.

I want to be able to create an article that’s 1,500 words long in a single request to the GPT API.

To do this, I’ll need to break the article down into 3 sections and prompt GPT to write 500 words for each section.

Then, I’ll need to combine those 3x 500 word sections to create the 1,500 word long article.

I want the final article to sit within a single database cell so the user can edit the final article in a text editor interface.

Is the right achieve this in Bubble is to create a recursive API workflow to return multiple 500 word outputs from the GPT API and then combine those outputs into a single database cell?

If this is correct, how do I go about combining the multiple API outputs into a single database cell?

P.S - I am a Bubble noob so please bear with me and please do correct me if I am completely going down the wrong path!

There are various approaches:

  1. Append your first request with a second one, and so on.
  2. Ask ChatGPT to attach an ID to help you find the exact text in your database that needs to be appended.
  3. Don’t forget to use ID as additional field in database , so you can use that in filters.
1 Like

Thanks for the response Eugene I will give it a go!