Action

Airtable: Create Record

Posted by agiletortoise, Last update almost 2 years ago

Demo of scripting record creation in Airtable. Needs to be modified to have baseId, tableName, and field values that map to an actual table in your account.

See Airtable integration guide for usage details.

Steps

  • script

    // set values from your account
    let baseId = "appOSVpC6cay6jFbX"
    let tableName = "Debug"
    
    // create Airtable value
    let at = new Airtable()
    let record = {
    	"fields": {
    		"F1": "Text for Field 1",
    		"F2": "Text for Field 2",
    		"Complete": true // checkbox field
    	},
    	"typecast": true
    }
    
    let result = at.createRecords(baseId, tableName, record)
    if (result) { // success! result contains record info
    	console.log("Airtable record created")
    }
    else { // something went wrong, log error
    	console.log(at.lastError)
    	context.fail()
    }

Options

  • After Success Default
    Notification Info
    Log Level Info
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.