Consuming an API array to create a list of things

Hi there!

I am trying to set up my Bubble app to consume an API I’ve created to display stats from a WhatsApp chat history.

An example of the API response when provided the url of the .txt file

Below is an entity-relationship diagram of my database setup that I feel best fits this but which I have not yet translated to a Bubble DB.

The ideal UX I am trying to create;

  1. User uploads a file (can be as a guest - without registering)
  2. Clicks button after upload is complete
  3. Database items are created through api consumption
  4. User is taken to a new page to display all the results

For the life of me I cannot work out how to consume the arrays in this API’s response to create the related entities. Happy to provide the details via DM on how to connect to the API for testing.

I have exactly the same issue. Bumping

This is very old … but still valid I think.

https://buildingonbubble.com/block/1472017471956x981892223072469000

Thanks Nigel - I think I might be missing something though? As I tried to mimic this behaviour but I’m unable to select those arrays to iterate through?

Is my API response incorrectly formatted to work as I expect?

Each time the api is called (with a legitimate payload), I need it to create;

  • 1 “Chats” record
  • n “Participant” records based on the number of participants in the returned response. (2 in my example response in the first post)
  • n “Emojis” records based on the number of participants in the returned response. (2 in my example response in the first post)
  • n “WordUsage” records based on the number of participants in the returned response. (2 in my example response in the first post)
  • n " ActivityPerDays" records based on the number of participants in the returned response. (2 in my example response in the first post)
  • n " ActivityPerHours" records based on the number of participants in the returned response. (2 in my example response in the first post)