[olug] Links from the Google apps presentation last night
Adam Haeder
adam at adamhaeder.com
Thu Jul 20 23:23:55 CDT 2017
The code is attached to the 'Test Form (Responses)' sheet. Here it is:
function myFunction() {
//set sheet parameters
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
var values = rows.getValues();
var lr = rows.getLastRow();
var submitId = 1;
var nameId = 2;
var questId = 3;
var colorId = 4;
var dateId = 5;
var datesubmitted = sheet.getRange(lr,submitId,1,1).getValue();
var name = sheet.getRange(lr,nameId,1,1).getValue();
var quest = sheet.getRange(lr,questId,1,1).getValue();
var color = sheet.getRange(lr,colorId,1,1).getValue();
var mydate = sheet.getRange(lr,dateId,1,1).getValue();
MailApp.sendEmail({
to: "adam at adamhaeder.com",
subject: "Test form submission from " + name,
htmlBody: "<br>A new form response has been gathered at " +
datesubmitted + ". Here is the data:<br>Name: " + name + "<br>Quest: " +
quest + "<br>Color: " + color + "<br>Birthday: " + mydate,
name: "adam at adamhaeder.com",
noReply: "true",
replyTo: "adam at adamhaeder.com"
});
}
On Mon, Jul 17, 2017 at 9:07 AM, Rob Townley <rob.townley at gmail.com> wrote:
> Adam,
>
> Which files contained the source script in your presentation? I did not
> have permission to open the two form files, but all the other files were
> empty under tools --> "Script Editor". In other files, "Script Editor"
> is disabled.
>
> https://drive.google.com/drive/folders/0B3NrseDGq4FgUHBGa2Y4QzBWdkk?
> usp=sharing
>
> On Wed, Nov 2, 2016 at 9:01 AM, Adam Haeder <adam at adamhaeder.com> wrote:
>
> > Folder with all the docs in it:
> > https://drive.google.com/drive/u/1/folders/0B3NrseDGq4FgUHBGa2Y4QzBWdkk
> >
> > Other links
> > http://gspread.readthedocs.io/en/latest/oauth2.html
> > https://github.com/burnash/gspread
> > https://github.com/google/gdata-python-client
> >
> >
> > --
> > Adam Haeder
> > adam at adamhaeder.com
> >
> > Check out my latest book: LPI Linux Certification in a Nutshell from
> > O'Reilly: http://bit.ly/bvQQ0I
> > _______________________________________________
> > OLUG mailing list
> > OLUG at olug.org
> > https://lists.olug.org/mailman/listinfo/olug
> >
> _______________________________________________
> OLUG mailing list
> OLUG at olug.org
> https://lists.olug.org/mailman/listinfo/olug
>
--
Adam Haeder
adam at adamhaeder.com
Check out my latest book: LPI Linux Certification in a Nutshell from
O'Reilly: http://bit.ly/bvQQ0I
More information about the OLUG
mailing list