I'm using automation.
I want to automatically add comments to the record when updating certain fields, but I can't..
What should I do
And. I keep failing to get records... I caught when record updated with trigger...
let table = base.getTable("Your Table Name");
let recordId = input.config().recordId;
if (!recordId) {
throw new Error("Record ID가 정의되지 않았습니다.");
}
let record = await table.selectRecordAsync(recordId);
let fields = ["fields1, fields2, fields3"];
let changes = [];
for (let field of fields) {
let oldValue = record.getCellValue(field); //
let newValue = record.getCellValue(field); /
if (oldValue !== newValue) {
changes.push(`${field} 값이 ${oldValue}에서 ${newValue}로 변경되었습니다.`);
}
}
if (changes.length > 0) {
output.set("changes", changes.join("\n"));
}
[Error]
ERROR
TypeError: Invalid arguments passed to table.selectRecordAsync(recordId, options):
• recordId should be a string, not undefined
at main on line 7