Webhook returns an array, how to parse it into multiple rows?

Hello guys !

Im ne here an I can’t wait to know more about airtable, but right now I can’t get what I need and that’s frustrating : i’ve got a webhook that returns me an array of values.
I want each value to be distributed to a unique row as “title”, but Airtable takes the array and puts it in one cell of one row. Not very useful !
Can I use a formula to distrubute values ?
Thank you,
Diane

You would either need to write your own custom JavaScript to process the array, or you could use a low-code automation tool like Integromat which can receive your webhook & automatically iterate through the array for you.

The necessary script is pretty simple. If you include a “Run a script” action in your Automation, add the array as an input config variable named arr that is the array from your webhook (left side of the screen), and the script would be:

// Change the names in quotes if necessary
let tableName = "Table 6"
let fieldName = "Name"

// Do not edit below this line
let {arr} = input.config()
let table = base.getTable(tableName)

let values = arr.split(",").map(v => {
    return {
        fields: {
            [fieldName]: v
        }
    }
})

while (values.length > 0) {
    await table.createRecordsAsync(values.slice(0, 50))
    values = values.slice(50)
}