Problem with a script

835 2
Showing results for 
Search instead for 
Did you mean: 
5 - Automation Enthusiast
5 - Automation Enthusiast

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;



2 Replies 2

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 :winking_face: