Help

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.

Update existing record with new info from Twilio Function

Topic Labels: API
789 1
cancel
Showing results for 
Search instead for 
Did you mean: 

Have a table I am sending Twilio SMS from, one field is 10 digit number [10DN]. Want to gather info through SMS replies, run a Twilio Function, and update that same record. Thanks in advance

Receiving this 82002 error!
Screen Shot 2020-03-25 at 1.34.16 PM|690x290

var Airtable = context.AIRTABLE_API_KEY;
var base_id = “appGRnjvExBkkhQa2”;
var base = Airtable.base(base_id);
var table_name = context.VOLUNTEERS_FOR_DELIVERY_TABLE;

var table = base.table(table_name);

// lookup the RFID number in our table and then update that record
// with additional data
table.select({
“filterByFormula”: “{10DN}=event.number”
}).firstPage((err, results) => {
if (err) {
// handle err;
throw err;
}

// results will be a list, but if the column we are searching for should unique, 
// then we should only have one element in the array

// if the uniqueness assumption here is not true, then you’ll want to turn this into a loop
var record = results[0];

// grab the record id
// and then push an update to this record
var record_id = record.id;
table.update(record_id, {
  "Confirmed": event.answer
}).then((result) => {
  // handle final result
  console.log(result);
}).catch((err) => {
  // handle error
})

});

1 Reply 1

Hi Jason - we are running into a similar issue. Did you ever figure out the final solution? Thanks, Blythe