It seems I can’t use a variable in the method
updateRecordAsync(record,{"field": value)
In the head of my script, I ask which field needs to be updated.
(ps: I use pseudo-code here to keep my question brief. Everything works, except the last line)
input.config({
input.config.field('selectedField', {
label: 'Which field do you want to update?',
parentTable: 'selectedTable',
}),
})
Let’s say I choose the field status.
Then I would like to use something like
updateRecordAsync(record,{selectedField: someValue)
or
updateRecordAsync(record,{selectedField.name: someValue)
However, the code above gives an error:
j: Field ‘selectedField’ does not exist in table
The code only works when I hardcode the field, which kinda defeats the purpose of scripting/automation…
updateRecordAsync(record,{"status": someValue})
question: is there some way to use a variable selectedField in updateRecordAsync or do I need to keep the fieldname hardcoded?