Welcome to the Airtable Community! If you're new here, check out our Getting Started area to get the most out of your community experience.

This is automations bug or code fault

Topic Labels: Automations
234 1
Showing results for 
Search instead for 
Did you mean: 


Hello, sometimes airtable automations return bad input variables after changing record input value.

I changed DESIGN_STATUS to Needs fixing, and Customer_status field changed to Waiting via automation. But my code says that when status become Needs fixing, it need to do other thing.
Its happens very rarely.
This is my code problem or air table ? What I need to do ?

My code:

let data = input.config();

let table = await base.getTable('Orders V3');

let view = await table.getView("FULL ORDER LIST AUTOMATIONS");

if(data.Design_status == "Needs fixing"){

    await table.updateRecordAsync(data.RecordId, {"Customer_status": {"name": "Needs revisions"}});

} else if(data.Design_status == "Supervisor approved"){

//Time to send reminder

const sending_time = new Date( + 2 * 24 * 60 * 60 * 1000 )

var dd = String(sending_time.getDate()).padStart(2, '0');

var mm = String(sending_time.getMonth() + 1).padStart(2, '0');

var yyyy = sending_time.getFullYear();

var today = mm + '/' + dd + '/' + yyyy;

let query = await view.selectRecordsAsync();

var records_to_update = [];

for (let record of query.records) {

    if(record.getCellValueAsString("Name") == data.ID){


        if(record.getCellValueAsString("Design_status") != "Supervisor approved") {

            records_to_update= [];





if(records_to_update.length > 0) {

    for (let record_id of records_to_update) {

        await table.updateRecordAsync(record_id,{

            'Cron_time': today,

            'Sended': true,






await table.updateRecordAsync(data.RecordId, {"Customer_status": {"name": "Waiting"}});

1 Reply 1

Check the run history for your automation to see what values are being passed into your script through input.config(). For this particular record, was Needs fixing the value that was passed in on your Design_status variable or something else?