Hey there!
- You can create a linked field between Table A and Table B (we will call it Created Records Link)
- Then create an automation triggered on “When record matches condition” that looks at your # Field in Table A. (you can use any trigger you’d like)
- Create a “Run a Script” step
- Create two input variables:
- numberOfRecords: look at the first step at the # Field
- linkedRecordId: look at the first step and choose the Record ID
Then drop in this script:
let inputs = input.config();
let numberOfRecords = inputs.numberOfRecords;
let linkedRecordId = inputs.linkedRecordId;
let recordsTable = base.getTable("Table B");
// Create three records in the Table B table linked to Table A
for (let i = 1; i < numberOfRecords + 1; i++) {
let recordId = await recordsTable.createRecordAsync({
"Name": "Test " +[i],
"Created Records Link": [{id: linkedRecordId}],
})
};
This will create the number of records that you identified in Table A # field in Table B. In this example I just created them with the name “Test” and the record number.