I am attempting to use Google Apps Script to download an excel file that is linked to on a CRM. That is, instead of each day having a person log in to the CRM, download new data as an excel file, and copy and paste the new data to our existing Google Sheet, I would like to have my script do so.
Is it possible to do this? I have been looking at UrlFetchApp, however I'm having trouble because there is no direct link to the file I need (only a link to generate and download the file).
Related
What's an efficient way of making an offline backup of a Google spreadsheet so that it includes its Google script files? It seems that if I use the Download as Microsoft Excel File feature, the downloaded xlsx file does not include any Google script that is part of the spreadsheet.
I saw a post about a command line tool called "Clasp" by Google that can be used but I was hoping to use something that is not so arcane.
I would like to allow my students to send me one or more files directly to my google drive via a form where they would just enter their name and choose the file(s) to send (drag and drop would be great). A folder with their name would be created in a specific folder on my drive and a warning email would be sent to me. Do you think this is feasible with google script? Thanks in advance.
An example here but paying ...
I've checked and Google Forms already allows for a File Upload kind of question (with drag and drop too).
It automatically creates a folder in your Google Drive (altough it doesnt create a folder for every student) (example here) and in the spreadsheet that it automatically generates there is a permanent link to that file (example here).
If that's not what you are looking for and you need the 'Folder per student' feature then yes, you can use google apps script to move files in folders quite easily.
Looking to automate the processing of data in a spreadsheet generated by google forms; specifically, I want to attach the files uploaded to the form to outgoing emails as attachments. The files can be synced to a local folder for the program to access, but the google form only has a url for each uploaded file.
What would be the most efficient way to determine which of the files uploaded correspond with each form submission and its corresponding link?
Edit: my research indicates that I may be able to use an identifier from the url to see which document it is through an apps api. Another thought was to scrape the html from the linked webpage and then to glean the file name from somewhere in the html here it hopefully occurs with regularity.
Then I could use the filename to construct a filepath to the synced folder on my local machine or would it be better to use the drive api to manipulate the file into an email attachment?
When a user downloads a CSV file from an arbitrary site, I would like to be informed of this event and automatically upload the same file as a Google Sheets file. Is this possible or would this be violating a fundamental browser security concept?
The CSV file in question does not have a URL, but is created on the fly by the arbitrary web site, when the user clicks a button. An example would be the user's list of financial transactions at a bank web site.
I am not new to Google Apps/Drive but I am new to Google Apps Script.
There is no way to detect that kind of events.
I can't even imagine a function that would allow for automatic file upload of a local file... don't forget Google Apps Script is a server based environment.
I have an interesting fairly simple problem I am trying to solve but I am at a loss on the proper code to get this to working correctly.
Basically, I have an very old local application running which allow me to print a receipt of a transaction. I have the ability to enable this receipt to be printed to a specific file within a specific directory on my computer or I can set it up to print out automatically to a printer on my computer. Currently I print the data out to a file, then copy the contents of that file and paste it into a word document template and then manually go through and format the data so it looks clean (I should note that the data prints out in fixed field format requiring a specific font and size so its pasts correctly. After all this is done I then email the word or pdf document out.
Essentially what I am trying to do here is automate this method and I thought this should be possible using a Google Apps Script.
My thought here was that it should be possible to:
save all the original files from my application to a specific
directory on my computer
sync that folder with google drive
have a google apps script automatically execute upon upload
have the google apps script automatically use a specific document
template I create with a header/footer and then paste all the
contents from the new file which was uploaded
have the google apps script pattern match certain elements within the contents of
the document and properly format it.
save the document to a specific location with a specific file naming convention
automatically email the document as a doc or pdf based upon a
specific regex matched field within the source document.
Could anyone provide a specific code example which demonstrates how Google apps scripts can be utilized to monitor the contents of a specific Google drive folder to trigger an event immediately after a new file is uploaded?
Thanks in advance!