Hallo,
i have a problem with the script.
i would like a template with next actions for a project with record picker function.
but the problem is with my script, i have two projects with the same name always after the script.
one project is empty and one projects with the template actions.
Problem is the projectid var. The script create always a new record.
Can someone help me pls with the syntax?
// pick tables from your base here
let projects = base.getTable(‘Projekte’);
let tasks = base.getTable(‘Next Action’);
// prompt the user to pick a template for our project
output.markdown(’# New project’);
let record = await input.recordAsync(‘Select a record to use’, projects);
if (record) {
// Customize this section to handle the selected record
// You can use record.getCellValue(“Field name”) to access
// cell values from the record
output.text(You selected this record: ${record.name}
);
let projectId = await projects.createRecordAsync({
‘Projekte’: record.name,
});
await tasks.createRecordsAsync(a
{
fields: {
‘Next Action’: ‘The first task’,
‘Projekte’: {id: projectId}],
},
},
{
fields: {
‘Next Action’: ‘Another task’,
‘Projekte’: n{id: projectId}],
},
},
{
fields: {
‘Next Action’: ‘The final task’,
‘Projekte’: n{id: projectId}],
},
}
])
output.text(‘Done!’);
} else {
output.text(‘No record was selected’);
}