Hi
This relates to this Topic
This is the code I have:
let repoT = base.getTable('Repo');
let sourceT = base.getTable('Source');
let record = await input.recordAsync('Pick a record', sourceT);
// let name = record.getCellValue('Part 1') + '-' + record.getCellValue('Part 2');
if (!record.getCellValue('Repo')) {
let name = record.getCellValue('Data');
// create the record in the repo table
let newRepoRecord = await repoT.createRecordAsync({
'Name': name
})
// set variable for today's date
let now = new Date().toLocaleDateString("en-GB");
//note that newRepoRecord is the record ID of the created record
// see this by logging the result:
console.log(newRepoRecord);
// now take the newly created record ID
// and set the linked field from this
let updatedRecord = await sourceT.updateRecordAsync(record, {
'Repo': [{id: newRepoRecord}],
'Part Created': "Part Entered " + now
})
} else {
console.log("Repo is already linked for this record");
}
I want to be able to update a field in the newly created record in the repoT table.
The field is called Type and the Value I like to write is Test. the field is a Single Select field.
After I created the record and updated the field I would like the user to be prompted with the expanded field view of that record.
Is there a way of achieving this?
many thanks
Tom