Search... Ctrl + K

Update record (airtable)
One script reply has been approved by the moderators Verified

Created by paulpyreneene 177 days ago Used 192 times 0 Points

No comments yet

Points: 0
deno
One script reply has been approved by the moderators
Ap­pro­ved
import { Airtable } from "https://deno.land/x/airtable/mod.ts";
import { Field } from "https://deno.land/x/airtable/mod.ts";

 /*
    @param: {wmill.Resource} at_con - https://hub.windmill.dev/resource_types/12/airtable-apiKey-baseId-tableName
    @param: {int} recordId  id of the record to be updated in table
    @param: {object} newRecord: data to be sent to airtable
    example:
    {
        Name: "Harry",
        Age: 44,
    }
    */

export async function main(at_con: wmill.Resource<"airtable">, recordId: string, newRecord: object) {

    const airtable = new Airtable(at_con);
    
    const updateSingleRecord = await airtable.update<Fields>(recordId, newRecord);

  return { message: "Updated single record in table" };
}

Submitted by rossmccrann 175 days ago

Edited 142 days ago

No comments yet