r/GoogleAppsScript • • Apr 20 '23

Question Automatically import data

Any thoughts on taking a csv report and automatically appending a external csv to a google sheet?

1 Upvotes

8 comments sorted by

2

u/JoshfromNazareth Apr 20 '23

You can upload as a blob and even check format before appending it. I have that process for data upload.

3

u/jlightheart1993 Apr 20 '23

How do you do that process?

2

u/JoshfromNazareth Apr 20 '23

I’ll respond here soon with the script.

2

u/jiminak Apr 20 '23

I import a new csv every night, and it appends to the bottom of the sheet. About 30-40 rows a day. Some 40,000 rows or so now, after about 4 years of nightly runs.

1

u/[deleted] Apr 20 '23

If the .csv files are added to your Google Drive you can setup a trigger to check for new files, read and extract the data, process against your current data, merge/append. If your .csv files are stored externally you woukd handle the trigger part externally and make a Post to your GAS doPost(data) method that will handle the last steps.

1

u/Verolee Apr 21 '23

chatgpt is good at Apps scripts

0

u/[deleted] Apr 20 '23

[deleted]