google-apps-script

Specify folder to save files to in Google Script

情到浓时终转凉″ 提交于 2021-02-08 10:33:37
问题 I have a simple form published through Google Apps Scripts that lets someone upload a file anonymously. The script works well, but it will always save to the root of my Google Drive instead of to a specific folder. I'd like it to create a new folder with the person's first name + last name (collected from the form) within a specific folder. I know I need to use the destination FolderID, just not sure how to use it properly. Here's my existing code: function uploadFiles(form) { try { var

Specify folder to save files to in Google Script

三世轮回 提交于 2021-02-08 10:31:58
问题 I have a simple form published through Google Apps Scripts that lets someone upload a file anonymously. The script works well, but it will always save to the root of my Google Drive instead of to a specific folder. I'd like it to create a new folder with the person's first name + last name (collected from the form) within a specific folder. I know I need to use the destination FolderID, just not sure how to use it properly. Here's my existing code: function uploadFiles(form) { try { var

Submit Form should display message after successful submit to Google Sheets

放肆的年华 提交于 2021-02-08 10:30:55
问题 I am trying to submit a form to Google Sheets. This step is successful and I am getting all the numbers in the sheet. Now I want to display a success message after the form is submitted and the result from Google Sheets is ok. How do I do it? I have tried various messages in javascript and ajax, but don't have much understanding about it. I have shown my code below so you can have a look at it. <form name="submit-to-google-sheet"> <select class="form-control custom-form" name="country_code"

Submit Form should display message after successful submit to Google Sheets

こ雲淡風輕ζ 提交于 2021-02-08 10:30:05
问题 I am trying to submit a form to Google Sheets. This step is successful and I am getting all the numbers in the sheet. Now I want to display a success message after the form is submitted and the result from Google Sheets is ok. How do I do it? I have tried various messages in javascript and ajax, but don't have much understanding about it. I have shown my code below so you can have a look at it. <form name="submit-to-google-sheet"> <select class="form-control custom-form" name="country_code"

Adding a Topic ID to a Google Classroom assignment

牧云@^-^@ 提交于 2021-02-08 10:27:18
问题 I'm trying to create an assignment using Google Apps script and place it under a topic that is also created in the same script. I have no problem creating an assignment when no topicId is specified, but as soon as I try to specify a topicId , I receive the following error when I run the script: API call to classroom.courses.courseWork.create failed with error: Invalid JSON payload received. Unknown name "Test Topic" Here is my code: function makeStuff() { var topic = { name: "Test Topic" };

What should I request the Gmail API to get email statistics?

风格不统一 提交于 2021-02-08 10:25:50
问题 I am interested in getting the number of emails sent and received(in priority inbox) on the current day. Nothing more. Using the REST API in Google App Script. 回答1: GET https://www.googleapis.com/gmail/v1/users/your_email%40gmail.com/messages?labelIds=SENT&q=newer_than%3A1d&key={YOUR_API_KEY} To get the number of messages received/sent in the last 24 hours, you can use the gmail.users.messages.list API. You must specify the following query: newer_than:1d to only get a list of emails that were

Apps Script - onEdit combine timestamp and username/email address not working

丶灬走出姿态 提交于 2021-02-08 10:16:15
问题 I'm attempting to pull the ActiveUser and Email Address of the person making the change to the Google Sheet and thought it would be possible using the following, but all I can get is the timestamp. If I change "var obj2 = (Session.getActiveUser().getEmail()); to literally anything else, it pulls the new data so I feel like the rest of my script is fine but can't figure out why it never pulls a username or address... Any thoughts as to what I'm doing wrong? I heard that possibly google does

How to Split Multi-line Cells Into Different Rows in Google Sheet

放肆的年华 提交于 2021-02-08 10:13:12
问题 I have a Google sheet that is very messy. In some cells, there are multiple email addresses, multiple names, multiple phone numbers, etc. Raw Data I want to split the cells with multiple email addresses into different rows with the exact same data for the other columns. Something like this: Cleaned sheet I used a script that I found another answer here on StackOverflow, however, the script only works if there's a return or space between the email address. The issue is that the sheet is very

Google Script to import data from Google trends

喜你入骨 提交于 2021-02-08 10:00:33
问题 just wondering if there is a script to import data from google trends into a google sheet. Basically, I would like to trigger such script daily to know the rising trends for a given topic and I am not sure if there is such solution available. Else, is there any solution to perform this task? Many thanks! 回答1: You may refer with this sample code snippet on how to use Google Apps Script for querying Google trends. For example, this function read input from the spreadsheet and sanitize it, then

Google Script to import data from Google trends

时光毁灭记忆、已成空白 提交于 2021-02-08 09:58:04
问题 just wondering if there is a script to import data from google trends into a google sheet. Basically, I would like to trigger such script daily to know the rising trends for a given topic and I am not sure if there is such solution available. Else, is there any solution to perform this task? Many thanks! 回答1: You may refer with this sample code snippet on how to use Google Apps Script for querying Google trends. For example, this function read input from the spreadsheet and sanitize it, then