Readme

Glide API 2.0: Bulk Import

You can fork this Val to implement your own bulk import to Glide.

Glide's high-performance bulk import API can load millions of rows into Big Tables. It's designed for importing your business data into Glide on a regular schedule (e.g. nightly).

We designed this API for customers who regularly import tens of thousands of rows or more to Glide using tools like Make. Our goal was to make this process more efficient and less expensive.

Note: This API is currently free to use. Future usage will cost approximately 1 update per 10k rows.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// 1. Start by importing the Glide helper library.
//
// Soon, this functionality will be part of the official
// @glideapps/tables npm package.
import * as Glide from "https://esm.town/v/dvdsgl/glide?v=661";
// 2. Add an environment variable named "glide" with your Glide API
// token.
//
// You can set this up here:
// https://www.val.town/settings/environment-variables
// 3. Identify the table where you want to import data:
const table = "replace-me-abc123-xyz456";
// 4. Implement row fetching using an API or a library:
//
// For example, you could call an API in a loop, using yield for each
// batch of rows to import.
async function* getRows() {
// Yield rows to import them:
yield { name: "David", favoriteTool: "Glide" };
// You can also yield arrays of rows:
yield [
{ name: "Mark", favoriteTool: "Glide" },
{ name: "Jason", favoriteTool: "Glide" },
];
}
// 5. Run the import.
//
// Warning: This API will completely replace the contents and columns
// of the target table.
await Glide.importTable({ table, getRows });
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
July 29, 2024