airtable.airtable.getrecord
Home > @runlightyear/airtable > Airtable > getRecord
Airtable.getRecord() method
Get record
Signature:getRecord(props: GetRecordProps): Promise<GetRecordResponse>;
Parameters
Parameter | Type | Description |
---|---|---|
props | GetRecordProps |
Promise<GetRecordResponse>
Example
Get a record
import { defineAction } from "@runlightyear/lightyear";
import { Airtable } from "@runlightyear/airtable";
defineAction({
name: "getRecord",
title: "Get Record",
apps: ["airtable"],
variables: ["baseId", "tableIdOrName", "recordId"],
run: async ({ auths, variables }) => {
const airtable = new Airtable({
auth: auths.airtable,
});
const response = await airtable.getRecord({
baseId: variables.baseId!,
tableIdOrName: variables.tableIdOrName!,
recordId: variables.recordId!,
});
console.log("Response: ", response.data);
},
});