Skip to main content

airtable.airtable.updaterecord

Home > @runlightyear/airtable > Airtable > updateRecord

Airtable.updateRecord() method

Update record

Signature:
updateRecord(props: UpdateRecordProps): Promise<UpdateRecordResponse>;

Parameters

ParameterTypeDescription
propsUpdateRecordProps
Returns:

Promise<UpdateRecordResponse>

Example

Update a record

import { defineAction } from "@runlightyear/lightyear";
import { Airtable } from "@runlightyear/airtable";

defineAction({
name: "updateRecord",
title: "Update Record",
apps: ["airtable"],
variables: ["baseId", "tableIdOrName", "recordId", "name"],
run: async ({ auths, variables }) => {
const airtable = new Airtable({
auth: auths.airtable,
});

const response = await airtable.updateRecord({
baseId: variables.baseId!,
tableIdOrName: variables.tableIdOrName!,
recordId: variables.recordId!,
fields: {
Name: variables.name!,
},
});

console.log("Response: ", response.data);
},
});