Understand how to pick 2nd item under data from Open AI message response

Hi Bubble Experts,
I have configured a workflow in my app to send and receive a message using OpenAI api. On the response message, the assistant response is stored under 2nd item inside data with the role “assistant”.
Inside my workflow config, I’m unable to pick the 2nd item, as it shows only first item, last item, random item and item#.

Is it possible to specify the item number and pick the text value under the role “assistant”?


Appreciate your help !

item # should do the job.
However, your goal is to show related data for the “assistant” role more than the second item. You should use :filtered role = assistant : first item

Also, are you sure you give enough time to have all the data/results after your call? Often, the issue is there…

Hi @Jici , yes I have tried to apply the filter on the role and also to retrieve the run and message only when the run status is completed.


Use debug mode yo inspect each part and the complete API response. Best if you can activate detect header and continue workflow if error to access raw body

I tried to split the workflow into two parts and it worked. Recurring event workflow which will check the Run status and will execute the getMessage call once the run is completed.
Thanks very much or your support!