So I have a google sheet set up with some automatic number calculations that will tell me how much stock to buy for my company, but the thing is it won't update when the sheet is opened. I tested this using my networth and wallet. I set up a cell to show me my wallet amount, then I withdrew $1 from my vault but even when I refresh the sheet, the number doesn't change from $0. I'm sure I am just making a really dumb mistake, but I don't know where.
Google sheets, API, JSON trouble.
Started by Acestins [1984739] on in API Development.
About this thread
Posts archived: 11 / 11 posts (100%) · the total is Torn's reply count + the opening post at the last fetch
Counted by TornLife from the archived posts.
- Archived posts
- 11
- Discussion span
- →
- People posting
- 7
- Likes on archived posts
- 2
- Posts by staff, officers and moderators
- 1
- Authority score
- 72 / 100
- Historical score
- 27 / 100
- Story score
- 33 / 100
- Engagement score
- 57 / 100
So I have a google sheet set up with some automatic number calculations that will tell me how much stock to buy for my company, but the thing is it won't update when the sheet is opened. I tested this using my networth and wallet. I set up a cell to show me my wallet amount, then I withdrew $1 from my vault but even when I refresh the sheet, the number doesn't change from $0. I'm sure I am just making a really dumb mistake, but I don't know where.
Are you accessing it from mobile or PC? The procs on Google sheets don't work right on mobile in my experience.
PC. I haven't even attempted to do this on mobile. Sounds too much trouble to do on mobile.
Did you actually set the script running? And if so how long and often? Do you see the api calls incoming in ur torn.com/pref > api key logs?
How is the sheet set up?
What I did in a similar situation was to put the calculations that need to be made into a script, via the script editor. This includes Torn API calls.
I then set up a trigger to fire every x minutes.
The script pulls dat as needed from the spreadsheet, and also populates the cells in the spreadsheet as needed using data from the Torn API and the calculations it makes.
Otherwise, only certain things in a Google Sheets spreadsheet will auto-update, I can't remember which but if I recall, only 3 functions will auto-update.
If that doesn't make sense let me know.
I then set up a trigger to fire every x minutes.
The script pulls dat as needed from the spreadsheet, and also populates the cells in the spreadsheet as needed using data from the Torn API and the calculations it makes.
Otherwise, only certain things in a Google Sheets spreadsheet will auto-update, I can't remember which but if I recall, only 3 functions will auto-update.
If that doesn't make sense let me know.
Try a timed proc. On the app script editor hit Edit -> Current Project's Triggers
Ope, prob should have said this some time ago, but it was kind of fixed, kind of not. It updates after like 15 minutes, which is fine for me.
You can make a function called onOpen which should run when you open it.
For mobile users, been a while since I tried but I remember onOpen or any other such triggers not working. Timed procs did work for mobile though.
Hey guys.
Are you using IMPORTDATA to get the API loaded in sheets? I found some limitations with that:
Apparently, the maximum amount of IMPORTDATA calls per spreadsheet is 50.
I am using 100+ and they seem to work fine on Sheet's side.
Under "Choose how often formula's calculate" it states IMPORTADATA happens about once an hour only.
I find it updates all when I open it if its been closed for longer than an hour.
Are you using IMPORTDATA to get the API loaded in sheets? I found some limitations with that:
Apparently, the maximum amount of IMPORTDATA calls per spreadsheet is 50.
I am using 100+ and they seem to work fine on Sheet's side.
Under "Choose how often formula's calculate" it states IMPORTADATA happens about once an hour only.
I find it updates all when I open it if its been closed for longer than an hour.