The Community will be temporarily unavailable starting on Friday February 28. We’ll be back as soon as we can! To learn more, check out our Announcements blog post.
Aug 12, 2022 12:28 AM
Hi there!
I’m not a developer but I trying to write a script.
Please tell me if is possible to use a variable to define the field name inside updateRecordAsync method.
await table.updateRecordAsync(record, {"Phone": value})
the method accepts variables for “record” and for field “value”
but I want to use a variable for “Phone” (without quote marks) like the example below:
let fieldName = "Phone";
await table.updateRecordAsync(record, {fieldName: value});
I want to let users set up fieldName using input.config
Please help. :pray:
Solved! Go to Solution.
Aug 12, 2022 02:17 AM
Hi,
use such syntax for that:
await table.updateRecordAsync(record, {[fieldName]: value});
Aug 12, 2022 02:17 AM
Hi,
use such syntax for that:
await table.updateRecordAsync(record, {[fieldName]: value});
Aug 12, 2022 04:43 AM
Thanks, Alexey! I appreciate it