I am exporting two csv files from an SQL server to a Google Drive folder using File Stream, the data of which I then need to pull into a Google Sheet (without setting share settings to public).
The process I have in mind is:
- Export CSVs to file stream (F1.csv & F2.csv) - WORKING
- Convert the CSV files to Google Sheets using App Script (F1.gheet & F2.gsheet) - WORKING
- Use =IMPORTRANGE in my master Google Sheet (Tool.gheet) to import F1.gsheet & F2.gheet into their own Sheets in that workbook
The issue I am running into, is that the two csv files will be exported and uploaded daily. I can convert them fine, but they will get new file IDs, which breaks step 3.
What I want to be able to do, is replace F1.gsheet & F2.gsheet with the contents of the new F1.csv & F2.csv, so that their file IDs stay intact and Tool.gsheet pulls the new data.
I have looked at How to automatically import data from uploaded CSV or XLS file into Google Sheets but it is extremely slow, I just need to be able to use something similar to the Google file revision feature, but with Google Apps Script.
Any help would be greatly appreaciated!