Here is my script. The goal is to copy a value from a field into another field, but the field variable is dynamic. The fields do exist and will match the fieldvalue input variable. However, i don’t seem to be able to update the record by using a defined variable. Here is my script:
let config = input.config()
let recordId = config.recordid
let name = config.fieldvalue
let table = base.getTable(“Verifier / Trainer Body”)
let query = await table.selectRecordsAsync()
let record = query.getRecord(recordId)
let field = table.getField(name)
let fieldval = field.id
console.log(fieldval)
let value1 = record.getCellValue(“VB Total Score”)
let copy = await table.updateRecordAsync(record,{fieldval:value1})
Thoughts?