Including a new record in a JSON array

I have emails coming into a webhook. The sender name and email passes in normally but the cc’d names and addresses pass in as an array.

I need to invite the sender of the email and the multiple cc recipients to an event using the google calendar module. I can pass in either the sender or the array of cc recipients but not both.

As a result I’m trying to create an array or update the existing array to “insert” the sender into an array and pass that array to google calendar. I simply can’t get it to work.

The closest I can get is to iterate over the CC recipients and then pass through an array aggregator. I then use a transform to JSON module to try to output a string. I then use OpenAI (which i’d rather not for this purpose) to update the string with the sender value before outputting it as a JSON array, but it never quite outputs correctly… only as a JSON string still.

See my blueprint attached.

The essence of my question is how do i update an array to include one record of the sender in with multiple records of the cc recipients.
blueprint (7).json (220.3 KB)

Welcome to the Make Community!

You can use the Parse JSON module to create a new item with the same collection structure as other items in the array.

Then, you can use the built-in function add to add it into the array.

If you require further assistance, my profile has a couple of links to resources that may help, or you can search my previous posts on my profile for answers to similar questions like these.

@samliew

Thanks @samliew - amazing help!

I have done the first step and created 2 of the same arrays:

Note the first 2 are gmail address and custom domain. The last is a hotmail address.

Would you mind clarifying for me how i use the “built-in” add function to put the latter into the array of the former please?

Thank you so much for your help