Create Multiple Records ( airtable)
One script reply has been approved by the moderators Verified

Created by nicolassirang 243 days ago Viewed 256 times 1 Point

No comments yet

Login to be able to comment
Points: 1
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: {object} new_record: data to be sent to airtable
    example:
    {
        Name: "Harry",
        Age: 44,
    }
    @param: {object} fields_list - type of data to be sent to airtable
    example:
    {
        Name: string;
        Age: number;
    }
    */

export async function main(at_con: wmill.Resource<"airtable">, at_table: wmill.Resource<"airtable_table">, new_record_list: object, fields_list: object) {
    const airtable = new Airtable({...at_con, ...at_table});

    type Fields = fields_list;
    
    const createMultiple = await airtable.create<Fields>(
    new_record_list
  );

  return { message: "Created multiple records in table" };
}

Submitted by rossmccrann 240 days ago

Edited 198 days ago

No comments yet

Login to be able to comment