Problem with a script

Hi everyone.
I’m trying to follow this guide and I’m told to setup this script but Airtable is complaining about this fieldsToSend.forEach

saying that forEach dosen’t exists on type string but I just copied it so it must work for him.

Does anyone know?

Here is the complet code

// Get the airtabel webhook URL
let webhook = ‘’;

// Airtable script button name.
let actionDescription = ‘Sending images to processing’;

let tableName = ‘Test Make’

let fieldsToSend = ‘Brand’

let table = base.getTable(tableName);

let record = await input.recordAsync(actionDescription,table);
let queryParams = ‘/?id=$(’
if(fieldsToSend.length > 0){
function buildParams(fieldName) {
let fieldValue = record.getCellValueAsString(fieldName)
queryParams += ‘&${encodeURIComponent(fieldName)}=${encodeURIComponent(fieldValue)}’
const returnedpayload = await fetch(‘${webhook}${queryParams}’);
var payloadResponse = await returnedpayload.json()
let result = payloadResponse.result;



Welcome to the Airtable community!

You probably changed the value of the fieldsToSend variable. It is currently a text string. Before was it an array of text strings? What was that original line like? What happens if you make it an array?

Thanks for the quick reply. I was missing some barckets :wink:

1 Like

This topic was solved and automatically closed 15 days after the last reply. New replies are no longer allowed.