Showing prompt text element is delayed due to API call

I wanna create a chat bot with Bubble using ChatGPT API using repeating group (usual chat bubbles). I have 2 text elements within a repeating group: prompt on the left and answer on the right below. When I submit my prompt:

  1. I create a new entry and fill a Prompt field in the Message data type and leave the Answer field empty.
  2. Then I reset empty relevant fields
  3. Trigger the ChatCPT API call
  4. When results are fetched update the entry with the Answer field

My problem is that the prompt text element only shows togehter with the answer, and not immediately after submitting it as intended…

How can I reach that the prompt text element does not wait for the results of the API call?

Ps.: of course, all the repeting group cells are fetching data dynamically from the DB.

Essentially, your prompt is only being displayed once the answer is fetched, right? One way to tackle this could be by optimizing your workflow or third party api integration services . Instead of waiting for the API call to return the answer before displaying the prompt, you could try showing the prompt immediately after submission and then updating it with the answer once it’s fetched. This might require some tinkering with your Bubble workflow, but it could potentially streamline the user experience. Also, since you’re fetching data dynamically from the DB, make sure your database queries are optimized for performance.