Found corrupted data while opening file using Google Sheets - google-sheets

I've been able to query from a Google Sheets table just fine for the past 6 months to a year and then all of a sudden I'm receiving the error: "Found corrupted data while opening file." Does anyone know why this is occurring even though there were no changes made to the Google Sheet.

I had the same problem. My tables' source format was CSV while using a spreadsheets.
To solve it, I deleted the table and recreated it with "Google Sheet" as source format.
For other tables I couldn't delete, I changed the source format by making a REST call.
https://cloud.google.com/bigquery/docs/reference/rest/v2/tables/update
Both solutions worked.

this happens occasionally...the error is on Google's side. the best course of action is to contact Google Sheets support and request recovery of your spreadsheet. it may take them 1-3 weeks to do so.

Related

Some fields in Google sheet are not recognized by GDS

I have a simple Google sheet that has 9 fields as shown below
Google sheet data source
When I connect this file as a data source using Google Sheets connector, I get ONLY 7 fields instead of 9 as shown below:
Data Source Editor
There are two missing files that cannot be recognized by GDS which are scenario and feedback fields respectively.
In order to solve this issue, I tried the following:
disconnect and reconnect the data source file again. But it did not work.
Also, I tried to use refresh fields but in vain too.
I tried also.
I could not find any reason for that behavior. please help if you can.
Here is a link to a sample Google Sheet file.
https://docs.google.com/spreadsheets/d/1GIHjwPp0uodUiJeXeX9RVr58hFz2re-6ilZYAeFU_Lc/edit?usp=sharing
Are these missing columns in your original google sheets file also empty? If yes, this is the reason why GDS is not recognizing those table. If you add some value in at least one row of these columns and reconnect the data source, they will show up.
If you intend to keep those columns empty for whatever reason, you can make a row with 'test' as values and filter those out in the report after connecting the data source.

importHTML (Google Sheets) formula stopped working

I used the following formula for almost a year now and suddenly it stopped working and is not importing the table.
=IMPORTHTML("https://tradingeconomics.com/matrix";"table";1)
It gives me a "Could not fetch url: https://tradingeconomics.com/matrix error. I also tried the importXML function - same problem.
I tried https://www.octoparse.com just to see if it was able to scrape the data. And it is able to scrape and parse out the data and export it to various formats (you need to install a program for it), although it doesn't solve the problem of automatically importing into Sheet via formula. 😕
Any ideas about what the problem could be and how I need to adapt the formula?
Note: I can't code, unfortunately.
There have being several posts here and other places about the same error message realted to IMPORTHTML. Here are some previous questions bout the same error message that were fixed without making any change:
Google spreadsheet importHTML Could not fetch URL
"Could not fetch URL" using IMPORTHTML
Sometimes the problem is caused by something on the Google side and there isn't any change that can be done on the formula to fix it, the only thing to do is to report the problem to Google from the help menu and wait. At this time the option is shown to me as "Help Sheets improve" but this might change without any notice as it has being done several times.
You might also report it through the official Google Editors Help forum.
Related
How to know if Google Sheets IMPORTDATA, IMPORTFEED, IMPORTHTML or IMPORTXML functions are able to get data from a resource hosted on a website?
try cached version:
https://webcache.googleusercontent.com/search?q=cache:ZNJKOXQm2t4J:https://tradingeconomics.com/matrix+&cd=2&hl=en&ct=clnk
=IMPORTHTML("https://webcache.googleusercontent.com/search?q=cache:https://tradingeconomics.com/matrix", "table", 1)

Importing a website table into Google Spreadsheet

I am trying to import this table into a Google Spreadsheet:
The table is available here:
https://competitions.lta.org.uk/sport/drawsheet.aspx?id=8D598CDE-8579-4541-B7AD-48558BF6FEA3&draw=4
Before Google changed their Spreadsheet addresses, I had the import working with ImportHTML(URL, "table", 2) - but this no longer works, even though there appears to be only two 'table' labels in the page HTML.
Looking for a way to abstract the table, I went to 'importXML' but tried several versions like 'importxml("https://competitions.lta.org.uk/sport/drawsheet.aspx?id=8D598CDE-8579-4541-B7AD-48558BF6FEA3&draw=4", "//div[contains(#id,'poule')]")'
and the same first part of the statement with "//table[contains(#class,'ruler')]")
but the formula fails with 'no content'
Would really appreciate some help to find a way to import this table!
Thanks in anticipation,
The reason you can't get the table data is because of the cookies page
Every time Google Sheets is trying to access that link, you need to accept cookies, and by default, Google Sheets won't do it.
You need to bypass or accept the cookies from the website to access data, you will need to implement more advanced things in Python or Google Apps Script

IMPORTHTML on Google Sheets returning a #N/A error, but only in one document

I have a Google Sheets document where I track the prices of several stocks. I made this a couple of months ago, and have been experiencing this issue for the past couple of weeks:
This formula returns "#N/A", the error description is: "Could not fetch url: https://finviz..."
=substitute(INDEX(IMPORTHTML("https://finviz.com/quote.ashx?t=VOO","table",11),8,2),"*","")
However, if I create a new Google Sheets document and use this exact formula, it works. Does anyone know what could be the problem?
I am having the same issue. Something must have been changed at finviz / google :(
There are also some discussions in the google support groups.
One possible solution could be to put all the symbols you're interested in into one URL, e.g. https://finviz.com/screener.ashx?v=161&t=FB,AAPL,GOOG,TSLA&ta=0&p=w
and then parse the resulting table.
Unfortunately I am not very good at the parsing part and have to do it by try and error.
But for example
=importxml("https://finviz.com/screener.ashx?v=161&t=FB,AAPL,GOOG,TSLA&ta=0&p=w";"//*[#id='screener-content']/table/tbody/tr[4]/td/table")
is at least showing some results in google docs. So this might be something to work with.
It will work again by removing 'SUBSTITUTE' and switching to table 8.
A2 = stock ticker
=ÍNDICE(IMPORTHTML("https://finviz.com/quote.ashx?t="&A2;"table";8);7;2)

Old Google Spreadsheet urls became invalid, how to retrieve new urls?

We have a huge collection of spreadsheets with statistical data. There is one "master-sheet" with links to all other sheets. Most of these links have been there for a long time. It seems Google has changed link-formats over time, including id's used to identify the sheets.
Old link format, used often in our master sheet:
http://spreadsheets.google.com/pub?key=rcTO3doih5lvJCjgLSvlajA
Newer link format, used occasionally in our master sheet:
https://docs.google.com/spreadsheet/pub?key=0AkBd6lyS3EmpdDlSTTVWUkU3Z254aEhERmVuQWZaeWc
Newest link format, where Google redirects when you visit a link in the "newer" format: https://docs.google.com/spreadsheets/d/1WipPWXQqXSjj9vPTu1LXD8IxeTfIn4RIBrGaOBd0DXc/pub
Now recently (since a week or so) Google seems to have quit support for the first format. I.e., most of our links are dead, so we can't access our spreadsheets. And we have no way to find out what the new, working, links are.
Does anyone know how to retrieve the spreadsheets when all you have is the old link? We don't have a Google Drive folder with the spreadsheets, so that solution doesn't work.
Thank you so much for any ideas!
You can take the ID of the old link and put it in place of the ID of the newer link (not the newest!), then it will work.
e.g. old link:
http://spreadsheets.google.com/pub?key=rcTO3doih5lvJCjgLSvlajA
Take rcTO3doih5lvJCjgLSvlajA and insert below:
https://docs.google.com/spreadsheet/pub?key=
Results in: https://docs.google.com/spreadsheet/pub?key=rcTO3doih5lvJCjgLSvlajA
You can then follow the redirect to get the newest version of the link

Resources