Search... Ctrl + K

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

Created by nicolasxxmctoastxx 178 days ago Used 449 times 0 Points

No comments yet

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

export async function main(at_con: wmill.Resource<"airtable">, at_table: wmill.Resource<"airtable_table">, new_record: object) {

    /*
    @param: {wmill.Resource} at_con - https://hub.windmill.dev/resource_types/12/airtable-apiKey-baseId-tableName
    @param: {object} new_record: object
    example:
    {
        Name: "Harry",
        Age: 44,
    }
    */

    const airtable = new Airtable({...at_con, ...at_table})
    
    const createOne = await airtable.create(new_record);

	return { message: "Created record in table"}
}

Submitted by rossmccrann 175 days ago

Edited 115 days ago

No comments yet