Hi @Ben_Swanson! Sorry - I totally missed this.
So - I’ve streamlined my setup and its now working nicely with even less scripting. I’m no longer using a script with google docs - instead using Zapier. Mostly because I didn’t know what I was doing with the script… and it had a few bugs, and Zapier works perfectly.
Once a day zapier runs a zap which adds a line to my google sheet.
In it, it stores the date, I convert that to a pretty date (to make processing with coda / formatting the google finance formulas in google sheets) and then adds in the finance formulas in each column.
These finance formulas look like this :
=INDEX(GoogleFinance(“CURRENCY:” & “GBP” & “AUD”, “price”,“1/17/2020”), 2, 2)
So the date its getting from the zap, but the rest is hard coded. I just add a bunch of these for the different currencies I need.
It means the final doc ends up looking like this :
Then about an hour later, another zap runs that brings all that data into my coda doc.
A problem I had earlier was that google finance didn’t always get data straight away. For reasons I’m not sure about, it would just ignore US data on a sunday, but it would appear the next day.
Thankfully, this doesn’t impact me greatly - but I was able to fix this just using a coda automation. Once a day it would look for ANY blank entry in a row of the currencies table, and then trigger another zap that re-imports than entire row from the data in the spreadsheet.
Does that point you in the right direction?