So as I understand the process, you want to:

  1. GET Hotel list from API
  2. display result in a Repeating Group
  3. parallely pass the results to Chat GPT + a predefined (or user generated) prompt that asks for recommendations based on the user preferences
  4. (Perhaps Highlight the results in the repeating group that are advised by GPT)

For the displaying in the Repeating group:
Isn’t it possible to make custom states on the repeating group that are somewhat as follows:

  1. Hotelname → List of text
  2. price → list of numbers
  3. currency → list of text
  4. … → all other properties that you want to display per hotel

→ As soon as the GET has resolved, save all these values (each items’ value xyz) into the RG’s custom states (Result of step 7’s hotels: each item’s property name → Hotelname) (Res of 7’s hotels: each’s price) etc. etc.

Then make Data source of RG e.g. the hotelname and then within the cell of the repeating group, get the other data of the lists by RG’sprice:item # current cell’s index?

I did that like this with another API call and it worked fine.

How you then pass that to ChatGPT is another question that you’re probably more familiar with than I am :wink:

Like this you don’t have to save the hotel to your DB which imo would add unnecessary clout to your DB where its perhaps hard to ensure that you don’t have double entries and you do not have to write to disk, everytime a user makes a request. (or is there a unique identifier number provided by bookings?

In my case, I only create an instance of the Object that I’m querying from the API when the user add’s it to another Object within my database, so I don’t fill the DB with unnecessary data.