Nov 22, 2021 10:38 PM
This is killing me. It’s literally the last speedbump in my first Airtable script:
I have this command:
await email.updateRecordAsync(dateArray[i][0],{‘ActualFieldName’ : linkID});
It works! But THIS…
await email.updateRecordAsync(dateArray[i][0],{fieldVar : linkID});
DOESN’T WORK. Even with the single-quotes gone, the system is still parsing my defined and assigned fieldVar as the string “fieldVar”.
It’s maddening. Any ideas?
Solved! Go to Solution.
Nov 22, 2021 10:52 PM
Wrap square braces around the variable that contains the field name.
await email.updateRecordAsync(dateArray[i][0],{[fieldVar] : linkID});
Nov 22, 2021 10:52 PM
Wrap square braces around the variable that contains the field name.
await email.updateRecordAsync(dateArray[i][0],{[fieldVar] : linkID});
Nov 22, 2021 11:06 PM
I love you.
That worked.