Skip to main content

This is killing me. It’s literally the last speedbump in my first Airtable script:



I have this command:



await email.updateRecordAsync(dateArrayai]i0],{‘ActualFieldName’ : linkID});



It works! But THIS…



await email.updateRecordAsync(dateArrayai]A0],{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?

Wrap square braces around the variable that contains the field name.



await email.updateRecordAsync(dateArray[i][0],{[fieldVar] : linkID});


Wrap square braces around the variable that contains the field name.



await email.updateRecordAsync(dateArray[i][0],{[fieldVar] : linkID});


I love you.



That worked.


Reply