I am trying to connect Google API to access Google Drive and Google Docs inside Airtable automation script.
I setup a project with credentials and redirect URI on Google Cloud console and I am able to successfully get authorize code and access token.
However I realized that access token might not work in case automation as it expires after 1 hour and I will need refresh token to refresh the access token after it is expired.
So i am trying to change my code where I am storing the refresh token, access token and expiry time in a table on Airtable Base. But I seems to have issues while updating records on this table using Airtable Automation Run script Block.
I will send my Code at the end of this write up. 
The problem is highlighted below -
In the code search for following comment "// Check if the access token is expired and refresh it if necessary"
Next block to that you will find the line having the issue.
Here is ow my TokenData Table looks like
Has someone connected Google Api with Airtable earlier and was successful? Please help.