Skip to content

Instantly share code, notes, and snippets.

@on2air
on2air / create_update_airtable_script
Created May 26, 2021
Airtable script to perform either an update or create depending on a match found
View create_update_airtable_script
const {id,name} = input.config()
//get table from base
const tblPipeline = base.getTable("📚 Content pipeline")
//get records from table
const pipelineRecordsQuery = await tblPipeline.selectRecordsAsync()
const pipelineRecords = pipelineRecordsQuery.records
//find matching record based on matching id from input and source_id in table
let match = pipelineRecords.find( record => record.getCellValueAsString("Source ID") === id )
View food waste tracker
const _ = require('lodash')
const Bottleneck = require('bottleneck')
const Airtable = require('airtable')
const settings = require('./settings')
////////////////Airtable Settings///////////
let atLimiter = new Bottleneck({minTime: 1000/5,maxConcurrent:1})
atLimiter.on("error", function (error) {
/* handle errors here */
console.log('at limiter error',error)
});
@on2air
on2air / same-table-backlinks.js
Last active Jun 21, 2021
Same Table Backlinks
View same-table-backlinks.js
@on2air
on2air / On2Air - Better Links Script
Last active Apr 27, 2020
Create fully formatted links in Airtable
View On2Air - Better Links Script
View Copy Values from 1 field to another
let formatter = [
{
table: 'Formats',
view: '',
fields: [
{
in_field: 'Currency',
out_field:'Currency Text',
},
{
@on2air
on2air / Script: Enhanced Content Calendar
Created Feb 26, 2020
This script enhanced the Content Calendar template with common functionality
View Script: Enhanced Content Calendar
/*****
 * Title: Enhanced Content Calendar
 * License: MIT
 * Author: Openside (Team behind On2Air products and BuiltOnAir community)
 * Sites:
 * https://openside.com - Openside Consulting Services
 * https://openside.com/#products - On2Air Products
 * https://builtonair.com - All things Airtable Community
@on2air
on2air / On2Air: Meta Extraction Script
Last active Feb 26, 2020
extract meta information from airtable base
View On2Air: Meta Extraction Script
/*****
* Title: Post Meta Data
* License: MIT
* Author: Openside (Team behind On2Air products and BuiltOnAir community)
* Sites:
* https://openside.com - Openside Consulting Services
* https://openside.com/#products - On2Air Products
* https://builtonair.com - All things Airtable Community
*
* Reach out for all your Airtable needs
View On2Air: Common Functions
/*****
* Title: Common Functions for Scripting
* License: MIT
* Author: Openside (Team behind On2Air products and BuiltOnAir community)
* Sites:
* https://openside.com - Openside Consulting Services
* https://openside.com/#products - On2Air Products
* https://builtonair.com - All things Airtable Community
*
* Reach out for all your Airtable needs
@on2air
on2air / On2Air: Default Values Script
Last active Sep 16, 2021
Script for setting default values in Airtable
View On2Air: Default Values Script
/*****
* Title: Manage & Run Default Values
* License: MIT
* Author: Openside (Team behind On2Air products and BuiltOnAir community)
* Sites:
* https://openside.com - Openside Consulting Services
* https://openside.com/#products - On2Air Products
* https://builtonair.com - All things Airtable Community
*
* Reach out for all your Airtable needs
View airtable-testing
{
"getCollabId": ( email ) => 'valid'
}