Record template Scripting Extension only
Scripting Extension only
This script creates a record in a Projects table, and automatically creates several Task records associated with it. You can use it to create more complex record templates.
Example
// pick tables from your base herelet projects = base.getTable('Design projects');let tasks = base.getTable('Tasks');// prompt the user to pick a template for our projectoutput.markdown('# New project');let name = await input.textAsync('Project name');// create the project - change the field name to one in your baselet projectId = await projects.createRecordAsync({'Name': name,});// create the tasks - change the field names to ones from your base.// the [{id: projectId}] links the newly created records back to our projectawait tasks.createRecordsAsync([{fields: {'Name': 'The first task','Design project': [{id: projectId}],},},{fields: {'Name': 'Another task','Design project': [{id: projectId}],},},{fields: {'Name': 'The final task','Design project': [{id: projectId}],},}])output.text('Done!');