Rochelle: Hello.
I'm gonna try to do something amazing here,
which is set up for my demo
while I'm talking.
So I'm gonna talk about Google Apps Script.
It feels kind of natural that you'd want to get your own data,
and then you want to do things with it.
And so Google Apps Script lets you do things with that data.
Let's you do things across apps.
So I'm gonna actually log on to a domain,
a test domain...
which has some examples on it.
Normally I would do this before I came up here,
but we didn't have the luxury of two machines here, so...
So I'll just quickly describe.
What Google Apps Script does for you
is it lets you automate actions across apps.
That's a fairly generic way to say
that it lets you do things that you would normally do manually.
It starts in spreadsheets.
It's intended to do more than that.
But in spreadsheets, there are very specific things you can do.
You can create custom functions.
You can access and edit data, formulas or formats.
You can do the things
that you would almost expect to be able to do in spreadsheets.
And then it goes outside of spreadsheets
to reach into Calendar,
to be able to create and look at events,
to be able to look at Mail--
in a very limited way, to be able to send mail, okay?
So there will be other things you can do in Mail eventually,
but right now it's just sending mail.
And you can do other things as well.
Grab data from a Web page and investigate it, look at it,
do things, act on it,
do URL Fetch, GET and POST,
and translate to other languages.
So I'm gonna show you some of those examples.
I'm gonna focus on three examples.
The first is fairly simple.
It's a custom function.
And these custom functions are extremely straightforward.
They're written in JavaScript.
All of Google Apps Script is JavaScript
with the extensions of the objects
that we give you access to.
So the way you access Google Apps Script
is through the Tools menu.
And right now, just to clarify,
we're actually in a limited test mode.
So you have to apply to get your domain activated.
And once it is activated,
you can access it the way I'm showing you now.
And I'll tell you now, just in case you want to visit--
We actually have the link
linked from the Google Enterprise Blog,
which is googleenterprise.blogspot.com.
It's still--I'm not gonna go into the detailed URL.
It's still the top post,
so you should be able to find it no problem.
But from the Tools menu, there's a Scripts submenu,
and you go to Edit Scripts.
And I'll just very quickly show you the code
of these custom functions.
And a script can contain more than one function.
So this script is called Convert.
It's got two functions in it.
The first is the inches-to-millimeters function.
It is definitely not the best way, actually,
to write a function that's gonna do conversion,
you know, to have each function
for every single conversion you'd want to do,
but I just wanted to illustrate the point.
You can see it's just plain JavaScript.
There is a declaration of variables.
There's a quick test to look at the input
and to return something in the cell
that says it's an error if it is,
to do the simple calculation,
and then to return that value to the cell.
So when you have a custom function,
it's expecting an input,
and it's gonna basically give you an output.
So what you can see here is I'm calling that function
as a normal formula, it's called in the spreadsheet.
And it's calculating the result for me.
So if I change the input,
it's gonna calculate the output.
So it's very standard.
And you can basically, you know, do everything you can do
with a...
spreadsheet once you have that function.
Again, my formats are a little wacky there,
but I'll just show you quickly how it would work.
If I'm doing parallel calculation, it's gonna--
Oh, it didn't do my extension for me.
I messed that up. Sorry.
But you can see what the gist of it is.
So in case any of you
are looking to convert many inches to millimeters,
I'll sell you this custom function.
This really, really took me a long time to develop.
Actually, it literally took about five minutes
to develop that one.
The longest time was just going to Google Search
and figuring out what the factor was to multiply by.
I didn't have that one memorized.
So the second example I want to show you goes beyond.
So you saw how to actually access Script--
it's in the Tools menu--
and how to do a custom function very simply.
And again, once you have data pulled in through SDC,
there are things you want to do with that data.
That's kind of the whole point.
This example might be a little bit more relevant.
We use this one in Google a lot now.
This is generally--
if you look at the generic-- the abstract of this example,
it's very popular, which is forms are used...
prolifically at Google and other customers.
And one of the things you want to do
is look at the data that came in on form,
the same way you'd look at data that came in through SDC,
and do stuff with it.
This one is going to send confirmation emails.
So you can manipulate the data, potentially, that came in
or look at it and prove it and send emails.
What I want to show you in this example is the two ways
that you can execute a script.
And this script is not a custom function.
This one is just processing.
The two ways are through a drawing object.
A drawing object can be assigned to macro.
So you'll see I can have a small menu--
it's a little bit hidden under my scroll bar there--
that I can assign a script,
and I assigned a name to that script--
"Email Confirm."
And the other way is through a custom menu.
So you can see the Confirm custom menu
with just one option here, which is Send Confirm Emails.
What this script does is it looks at this field
to see was this confirm ever sent?
And if it was, it won't send it, but if it's not, it will.
So I'll click on that button,
and it's running the script.
You can see it started, and now it's marking them as sent,
and it's giving me a time stamp as well.
So if I wanted to resend it,
you know, I could basically blank this out and resend,
and it'll send it again.
So I'll quickly jump to--
Well, I shouldn't say quickly, 'cause I'm just not fast enough
typing when I'm presenting.
But I'll jump to my Mail account,
so you can see the email.
The email that came in was defined by my script.
My script said, "What do I want that email to contain?"
So you can see all those responses just came in
within the last minute.
And the contents of that email is defined by my script.
I put in there what I wanted to in the format that I wanted.
So it's an HTML string, basically,
that I sent out to that email.
I could also create attachments
and formulate those attachments
and put them in that email payload as well,
and they would come through as attachments,
which is kind of neat.
We actually do that--
For the documentation of this product,
we're creating the documentation
in an automated way using script.
We have a spreadsheet
that contains all of our documentation,
and anybody on the team can go in and change things,
fix things, whether they're engineers or not,
and then somebody pushes a button,
and it sends all that stuff over to the Webmaster
to put it in the Help Center.
So it's really an interesting way to--
I have to say, the attachment process was created--
that feature was created specifically for the team.
I guess when it's something that they're asking for,
they get to put it at the top of the list.
So the third example is translation.
This is using another one of these objects,
these beans,
which also illustrates one more point,
which is just analyzing,
or using, my currently selected range.
So this is a rather, in some ways, dumb function,
which is it's just gonna take what I selected.
It's gonna translate it and throw it to the right.
It's just gonna put it in that highlighted area
that I have to the right.
And again, I created a menu option for that,
and I, in this case, created four different caller functions
so that the menu can be a little bit more user friendly.
And I'll say, "Let's translate that to Spanish."
It started running the script.
You can see down below, it's doing the translation.
And when it finishes, it'll say that the script is finished,
and the results are there.
Again, like I said,
there's so much you can do from that point.
This is really just to illustrate.
One of the, you know, really obvious examples
is to be able to translate content and email
to someone who's not even on the product.
So you can actually do translation
and send information to customers or partners.
I'll show you one more thing that's just--
at the risk of it not working
just because I wrote it late last night--
which is a conversion function.
Since I showed you the wrong way to do inches to millimeters,
I'll try to show you a better way.
This is actually translating different things.
And what I did is I'm translating
from U.S. dollar to Euro.
And, you know, that should work.
Let's see if it changes that.
But I can also say, "I want to translate from feet to--"
I don't know, somebody give me--
What do you want to translate feet to?
Yards.
Hey, 30 feet is 10 yards.
Yeah, I can even--
You know, I can do liters to gallons.
Pretty much anything.
And the way I do that is through URL Fetch.
I'm using Google Search.
I'm using the in operator.
I don't know if anybody's ever used that.
But I just basically formulate the search string,
and then when the payload comes back,
I look at the string, and I came up with a very--
This is what--You know, the only thing that took any time
was I look at that data that came back,
and I find the answer.
So if you look at this script,
it's fairly simple but convoluted.
This is a great sign of my horrible coding.
But it's--you know, it's mostly comments, actually,
but I have to find the third table and find the equal sign
and look for the units, and I'm there.
But it's just an example
of how to actually call out to external services,
whether they're your own or something else,
through the URL Fetch option.
And that's pretty much it.
The most important thing here, I think, is the extensibility.
We're gonna be adding--reach out to other Google apps,
as well as non-Google apps at some point.
But very shortly,
you'll be seeing enhancements to this.
Like I said, go to the googleenterprise.blogspot.com
if you want to apply to have your domain in this limited test
that we're doing right now.
It's likely you can be accepted into that,
and fairly soon you'll see it
launched across all of Google apps.
That's it. Thanks.
[applause]
Do you want to take questions now?
Do we have time for questions?
Great.
Do they have the mic on?
man: There we go.
Question about--two quick ones, one about the email.
You mentioned that you can put attachments on that
before sending out the email.
Can you format the attachments to be in-line
or just payload attachments on an email?
Are there ways of configuring that so that--
Say, can you format it as HTML?
Rochelle: You can pretty much do anything.
In other words, that attachment is really, literally,
just a bitstream.
It's a blob. man: Okay.
The other one is, you mentioned--
In the little script you wrote to convert,
you looked for the unit character.
How do you find the units?
Rochelle: It's really just pattern matching,
and it just took some testing, to be honest.
I mean, if you could see me writing this thing,
it was almost funny, 'cause I just kept returning
whatever I could find until I narrowed down,
and then I had to find some crazy ASCII character
that represents a comma.
It was insane.
But it was simple to write and then hard to perfect,
and I would say it's still not perfect,
but it is useful, actually.
man: So one thing I haven't seen yet or heard anyone talk about
is what are the scalability and deployment guidelines
for the Secure Data Connector on my server?
I mean, it's deployed to one box is what it looks like here
via 50,000 employees.
How is that gonna work?
How many boxes does it deploy to?
What's failover?
Can you guys talk about that at all?
man #2: There's more documentation on the site,
but in short, basically, you can run multiple instances
of the SDC agent and the failover
to each other.
man: Okay. man #2: Yeah.
Rochelle: Any other questions?
man #2: Any other questions?
man: When is this gonna be broadly available?
Rochelle: I'm sorry. Say that again.
man: Accessing data, say, you know,
behind corporate firewalls and whatnot.
Rochelle: Secure Data Connector? man: Yeah.
man #2: What I have demoed today are all in production,
so you can do it today.
And all the--The two products are Open Source products,
so you can download and configure them yourself.
Rochelle: Yeah, so the limited test that I was talking about
was literally for Google Apps Script,
not for Secure Data Connector.
man: What about dynamic data in forms?
man #2: What--Oh.
man: Spreadsheet forms.
Rochelle: I'm sorry. man: Forms?
Spreadsheet forms. Rochelle: Yeah, what about them?
man: I don't know if there's a talk specifically on forms,
but a big need we have is making dynamic forms--
are more, you know, responsive to actual data.
Rochelle: Yeah, so one of the things
that we expect to add to Google Apps Script
is event processing.
So I'm thinking-- Tell me if I'm wrong,
but what a lot of people are asking for is to do things
like when a form submission comes in, do something.
Is that what you mean?
man: Well, no, actually pulling data,
creating dynamic questions...
Rochelle: Ah, okay. man: from a data source.
So, yeah, that's interesting.
Since we don't yet have a good API
into the forms capability of spreadsheets,
we don't have anything on Script that reaches into that.
But we do expect to do that. It's just not there yet.
Yeah, forms is an incredibly popular feature right now,
so we expect to do a lot more with that.
Okay, looks like we're done. Thanks.
man #2: Thank you.
[applause]