importdata() function not working, despite. it working recently - google-sheets

This week my importdata function stopped working. It used to update every hour with no issues, then I put in a script allowing it to update daily instead. This was fine for about a week, and now this week it no longer works and returns an NA. I removed the script and that worked for a day, refreshing every hour. Now importfunction does not work at all. its as if it is slowly decaying on my workbook. the same function and link work on a brand new workbook.

Related

Google Sheets - How to set a daily shift reminder on sheets (kind of)

I've been trying to do this for a while but can't find a solution. At work there is a special task that needs to be done daily by different people, on rotating shifts. I am trying to create a simple file in sheets in which you can go and clearly see who should be doing that tasks that day.
The data comes from a schedule that is located within the same file. Every day different people are supposed to do these tasks
So what I am trying to do is basically a formula (s) that will recognize what day is today and present it so everyone knows who is supposed to do those tasks today. This should update itself everyday, taking the data from the database. So if today is Friday 20/08/2022 it will show whatever is on the database for that date. If today is Saturday 21/08/2022 it will update and reflect what the schedule/database has.
Sounds pretty easy but I dont know where to start.
Thanks for your help!
try:
=FILTER(C:G; A:A=TODAY())

Can I solve the importxml loading error through GAS?

I have filled a google spreadsheet with around 10 URLs and Xpaths. After discovering that ImportXML has some drawbacks (it is getting perpetual loading errors, even when there are only 1 or so functions running). I am looking for another way to populate the sheet.
My first solution was to delete the importxml and implement a write and repeat macro.
However, after about two months, all the seats suddenly stopped working.
Is there a way to solve this with a script?
There is a sample sheet that has stopped.
https://docs.google.com/spreadsheets/d/10Ljo7SESFdGj1Xc7U_Tg3gljHhfqbuyVV5Whulezyv4/edit?usp=sharing

All time based triggers seem to run at the same time

I have multiple time based triggers in a google sheet (most of which are supposed to run every 15 minutes and one of which is supposed to run once a day). These scripts that the triggers run simply generate random numbers in specific cells (one per each script/trigger). These cells changing then triggers a script that pulls from an API. The issue is that I can only pull so much from the site's API before it locks me out (60/pulls per minute is the limit). The scripts seems to all run at the same time on occasion (including the one thats supposed to only run once a day) which results in me being locked out of the API and receiving no data. Does anyone know why everything would be running at the same time? This happens when the once a day trigger shouldn't be active too.
For this use case you might be better off chaining your functions.
So you would only schedule functionA(), and at the end of it you call functionB(), and so on.
That also allow you to put a Sleep() function between them if your API requires it.
If every function are in the same project that's straightforward, but if they are in different project you will need to publish your projects as libraries.
It's not pretty but it will do the tricky.

Google Sheet API isn't updating for document too large

i'm using google sheeet api to update a spreadsheet every day.
For 2 months it worked perfectly, but suddenly it stopped on update.
I tried to run it in my machine and i received the error:
json returned "This document is too large to continue editing."
i tried some things to fix it but without sucesss. As you can see it accuses me of the document being large, but the document was as big as always. I tried to update the document writing only ONE LINE and i received the same error...
Also i tried to create a other spreadsheet to receive the complete update (that should be "too large") but it worked perfectly... ok, my code is working in other spread sheet and not in the first one...
I also tried to edit the first spreadsheet manually, but i can't, the spread sheet stays in the status 'saving' or 'reconnecting', but never saves.
Well... Yes, i can use the second spreadsheet that is working, but probably the problem will come back, so i would like to resolve this permanently.
Somebody can help me?

Automating new cell entries based on condition

First-time caller, long-time listener. I'm sorry if the title is a bit off, not really sure how to vocalize this issue. I have built a system at work for our work-study students to clock-in on. Unfortunately, the rest of our University is on a paper system and I cannot accept that. The system is made from two parts. The first part is a Google form where clock-in information is reported, it also includes a filter that separates that information based on pay period. The second is another sheet that imports that data and formats it into a printable timecard.
Here is the problem in a nutshell. We have students that work past midnight, potentially to 2:00 am. I need this system (or some system) to clock them out at midnight and clock them back in on the following day at 12:00 am.
Not even sure where to start with this one. I guess I need a script? A solution, advice or just a point in the right direction would be greatly appreciated. Thanks for your time all!
Form & Filter:
https://docs.google.com/spreadsheets/d/19LfKUQY6etiRY2wuyFYM8Jzay7IGXrwn0rHKgDwnmE4/edit?usp=sharing
Pay info and Timecard format:
https://docs.google.com/spreadsheets/d/1-2-7D7AHi6J-4cURlOsQOC1KznCR6zsejkTbyBFamjA/edit?usp=sharing
It sounds like a cool project! Here are some thoughts:
Using the Script Editor at Tools > Script Editor in Google Sheets:
You can collect the clock in and clock out timestamps.
You go through those cells in the code and if the day is different in between Clock in and Clock out, we know the student worked overnight. Now you do this:
You take the clock in time and make the clock out time midnight on that day.
You insert a new row after the Clock in row (sheet.insertRow()), and then in the new row you set the Clock In time to 0AM and the Clock Out time to the departure time.
I imagine people have already done this before and faced your same problem, so here are some examples I found online, although they may not address your specific issue:
https://bazroberts.wordpress.com/2017/03/06/apps-script-clocking-in-out-system/
You may be able to find a Google Sheets add-on for this - I see a couple on the store: https://docs.google.com/spreadsheets/create?addon_store
This might point you in the right direction. I check for a PM followed by AM. If it finds this condition, it splits it into two calculations. One up to midnight and the other on for after midnight. The next day looks back and if after midnight time occurs it picks it up. If no after midnight time occurs, it does what you do now. I think you can make this work (you will need to add a couple of columns which you can hide). I don't know what you would do on the last day of your time card. Below is an example you can copy:
https://docs.google.com/spreadsheets/d/1cO1ggY05kz70lfPE0YZCXaaa0AiaGKDM1s9FQPnw6Zs/edit?usp=sharing

Resources