Creating Google Sheets Direct Download Links to a CSV File

When you want to link to files in Google Sheets, by default, a link is created to a web page that displays an image. Please note that the link provided in this example is not a real link. If you want to directly link to the image itself, follow these steps:

1. Go to the file in Google Sheets.

2. The link will have a similar format to this: https://drive.google.com/file/d/2p91UaHNzqUqyBWXqQRiu9-QXbLs6ggjw/view. The long string of letters and numbers in the link is the filename. Copy this and save it in a notepad or somewhere accessible.

3. In Spark, copy this link: https://docs.google.com/spreadsheets/d/{key}/gviz/tq?tqx=out:csv&sheet={sheet_name}.

4. Replace {key} with the string from above (for example, 2p91UaHNzqUqyBWXqQRiu9-QXbLs6ggjw).

5. Replace {sheet_name} with the name of the sheet (for example, Sheet1).

6. Your link will now look like this: https://docs.google.com/spreadsheets/d/QXbLs6ggjw/gviz/tq?tqx=out:csv&sheet=Sheet1.

7. Now, Spark will be able to pull the file from this location.

8. The link can be publicly accessible or private, available to anyone who has the link.

9. That's it! This link will now directly download a CSV file.