Skip to main content

Airtable Integration

Manage your video uploads to social media platforms directly from Airtable.

Set Up

Running Airtable Automation Scripts requires a paid Airtable plan that includes automations with scripts.

This guide shows you how to automatically upload videos to social media platforms from Airtable via Upload-Post.

Gather Your API Key

Start by getting your API Key from your Upload-Post account in the "API Keys" section. This key will be used in the script.

Be sure you have configured your social media accounts in Upload-Post before proceeding.

Create an Airtable Workspace

In Airtable, create a new workspace with these fields:

  • Title as Single Line Text
  • Platforms as Multi Select with types: tiktok, instagram
  • Video as Attachment
  • User as Single Line Text
  • Status as Single Line Text

Enter Test Video Data

Add sample data to test the integration:

  • Title: Enter a title for your video
  • Platforms: Select one or more platforms (tiktok, instagram)
  • Video: Attach a video file (MP4 format recommended)
  • User: Enter your username
  • Status: Enter pending (lowercase)

Build an Automation Script

Let's create an Airtable automation script that uploads videos via Upload-Post:

Add Trigger

  1. In your workspace, click on Automation then +New automation
  2. Name the automation
  3. Click Choose a Trigger
  4. Select When a Record is Created
  5. Select your table
  6. Click Done

Add Action

  1. Click Add Action
  2. Select Run Script
  3. Delete any default code in the script editor
  4. Copy and paste this code:
const API_KEY = "Your API Key"; // Get your key at app.upload-post.com

console.log(`Starting Upload ${base.name}!`);

const uploadVideo = async (data) => {
const { title, platforms, videoUrl, user } = data;

const formData = new FormData();

if (title) formData.append('title', title);
if (user) formData.append('user', user);

// Add platforms
if (platforms && platforms.length > 0) {
platforms.forEach(platform => {
formData.append('platform[]', platform);
});
}

// Download and attach video
if (videoUrl) {
const videoResponse = await fetch(videoUrl);
const videoBlob = await videoResponse.blob();
formData.append('video', videoBlob);
}

console.log("Uploading video to platforms:", platforms);

const response = await fetch("https://api.upload-post.com/api/upload", {
method: "POST",
body: formData,
headers: {
"Authorization": `Apikey ${API_KEY}`
}
}).then((res) => res.json());

return response;
};

const table = base.getTable("Videos");
const query = await table.selectRecordsAsync();
const filteredRecords = query.records.filter((record) => {
const status = record.getCellValue("Status");
return status === "pending";
});

for (let record of filteredRecords) {
const title = record.getCellValue("Title");
const video = record.getCellValue("Video");
const platforms = record.getCellValue("Platforms");
const user = record.getCellValue("User");

if (!video || video.length === 0) {
console.log("No video found for record");
continue;
}

const response = await uploadVideo({
title,
platforms: platforms.map((x) => x.name),
videoUrl: video[0].url,
user
});

console.log(response);

if (response) {
let status = response.status === "success" ? "success" : "error";

await table.updateRecordAsync(record, {
Status: status
});
}
}

Replace Your API Key with your actual Upload-Post API key.

Test the Script

In the script editor, press >Test

The script will run and process any pending records. If successful, you'll see your videos being uploaded to the selected platforms, and the Status field will update to "success".

Security Best Practices

  • Never share your API key
  • Consider using environment variables where possible
  • Review records before processing large batches

Questions

If you have any questions about the Upload-Post integration with Airtable, please contact [email protected].