I am receiving a cryptic error when attempting to create a record using the code below:
// Change this name to use a different table
let table = base.getTable("Touchpoints");
//let ctable = base.getTable("Contact");
// Prompt the user to pick a record
// If this script is run from a button field, this will use the button's record instead.
let record = await input.recordAsync('Select a record to use', table);
let billTillString = await input.textAsync('Bill Orders till which date? (format YYYY-MM-DD)');
//let notes = await input.textAsync('Any Notes to mention');
let billTillDate = new Date(billTillString);
/*
//newRecs[0]['id'] = 'recDYGIT7fj80tTAH';
//let namer = new Array('recDYGIT7fj80tTAH');
//let Contact = record.getCellValueAsString("Contact"); // Contact RecordID
//let recordID = record.getCellValueAsString("Contact RecordID");
//console.log("ID is: " + recordID);
*/
await table.createRecordAsync({
'Start Date/Time': billTillDate,
'Contact': [{id: 'recI7YlIh4jJkUiYT'}],
'Notes': 'Sample Note'
});
/*
console.log(billTillDate);
if (record) {
// Customize this section to handle the selected record
// You can use record.getCellValue("Field name") to access
// cell values from the record
console.log(record.id);
} else {
output.text('No record was selected');
} */
https://share.getcloudapp.com/NQuWLz8y
It's also INCREDIBLY slow - any input or ideas would be much appreciated. Thank you!
P.S. I'm just trying to create a new record with a date which is inputted along with a linked record.
Video for context: https://share.getcloudapp.com/d5ugL4Z6