I'm currently running a script button that will copy the 'Reservation Requested By' value to 'Reserved for' value.
let table = base.getTable("Status Report");
let record = await input.recordAsync('Reservation Requested By', table);
if (record) {
let oldValue = record.getCellValueAsString("Reservation Requested By");
let newValue = oldValue;
output.text(newValue);
await table.updateRecordAsync(record,{"Reserved for": newValue});
} else {
output.text('');
}
I want to add a condition to this button so that if the 'reserved for' value is not empty, or exceeds certain days then remove the value.
Can I do that?