Help

Script to load multiple records

685 1
cancel
Showing results for 
Search instead for 
Did you mean: 
jlaplante
4 - Data Explorer
4 - Data Explorer

Greetings!  New to Airtable.

I have a survey table that I need to load blank records (roughly ~120 records for every new survey).

I currently have automations set to add records one by one - it's a major pain.

Is there a way to write a script to (1) load "seed" records from a table in my base and then (2) add them to my survey table?

 

1 Reply 1
Alexey_Gusev
13 - Mars
13 - Mars
Hi
example of script
For numbers more than 50, Array should be splitted by 50 record batches .
You can find example how to do it...  I think, here in search.

 

 

let example = {fields: {'FieldName': "some_value"} }
let table=base.getTable('YourTable')
let toWrite=Array(40).fill(example)
await table.createRecordsAsync(toWrite)