Parsing a JSON object with a list field, and creating a DB object for each item in the list

Hello, I’m trying to parse a JSON object with this structure:

{
“data”: [
{
“name”: /name of contact/
“email”: [ /list of email addresses/ ]
},
{ /another contact with name, list of emails/ }
]
}

When I receive this object, I want to store Contacts (that store a name) and Contact Email Addresses (that point to a Contact) in my database. Bubble has made it easy to create the Contacts, but not the email addresses.

For each contact I get something like this:

But instead of getting each individual email address, I get this:

This is what I’m doing in Bubble.

  1. Getting the list of contacts and scheduling an API workflow to create a Contact in the db for each object in JSON data. I pass the contact’s name and list of email addresses, thinking this list could be parsed by a separate worklow.

  2. Creating the contact, which is fairly straightforward.

  3. For each contact, call a workflow that creates a Contact Email Address. I have a key called email_addresses as a list of texts so I schedule an API workflow on it. But it seems like I’m unable to iterate through this list, and I’m only able to pass the list of texts as a single string of text, like “daniel.gittelman.20@cnu.edu, danielgittelman@yahoo.com


Any suggestions? TIA