0

I am attempting to have a self refreshing formula to import the latest data from a .csv saved in the same Google Drive location as the spreadsheet. The .csv I have set Share permissions so that "Anyone with the link can view".

I put the .csv's document id into cell A1 and use the formula:

=importdata("https://docs.google.com/uc?export=download&id="&A1)

Which works fine while I have the document open (all columns and rows import correctly). If I close and reopen the sheet, another user opens the sheet, or some amount of time passes; the formula then gives an error:

Error message

Error
Could not fetch url:
https://docs.google.com/uc?export=download&id=...

I have tried multiple modifications to the formulae used, and though I can get them to work, they always end up failing in the same way.

Rubén
  • 34,714
  • 9
  • 70
  • 166
  • Have you tried using triggers and apps script to execute the importdata()? I have found this issue on google support that has a workaround: https://support.google.com/docs/thread/15635541?hl=en&msgid=16402125 – Kessy Feb 24 '20 at 14:48
  • Even if I got that working (not possible unfortunately as my business account has Apps scripting disabled), it would not solve the issue in a way that meant the imported data never showed an error. The imported data is displayed live on a public site, so even intermittent errors are far from ideal. – Alasdair Duncan Feb 25 '20 at 08:35
  • What happens when you put the link in a new tab in the browser? – Kessy Feb 25 '20 at 14:12
  • The (Edge) tab closes itself and a download popup appears at the bottom of the screen with options for "Open", "Save ^", and "Cancel". Choosing "Open" results in the .csv file opening correctly. – Alasdair Duncan Feb 27 '20 at 13:53
  • Importrange is not for importing from csv, only for other sheets etc. – Alasdair Duncan Mar 05 '20 at 14:58

1 Answers1

0

Instead of https://docs.google.com/ try usign https://drive.google.com/

The above because there are a lot of questions that use the later, but most imporant because the current domain of the service is https://drive.google.com/

Related

Rubén
  • 34,714
  • 9
  • 70
  • 166