Apps Script Office Hours – September 13, 2012


JAN KLEINERT: Hey, welcome to
another episode of Apps Script Office Hours. I’m Jan Kleinert. We have a new team member
here with us today. This is Arun. So he’s joining us for
the first time. And he’s also a member of the
Apps Script Developer Relations Team. So let’s go ahead
and get started. First, before we jump into the
questions that we have in the Moderator page, I wanted to
show you something in the Chrome Web Store that
we added this week. So I’m going to turn on
screen sharing here. And show you this window. So we posted a Google Apps
Script app, which basically will take you to
script.google.com, which is the standalone script editor
in the Chrome Web Store actually just yesterday,
I guess it was. So if you use Chrome and you
also use Apps Script a lot, this would be a handy web
app for you to install. What it will do is, you’ll get
an icon for Apps Script on your new tab page. It’ll make it easy for you
to find it and launch it. So check it out. And again, it simply will take
you to script.google.com to the standalone script editor. So let me jump over to Google
Moderator here. So we have four or
five questions. And we’ll just work
through them here. And then once we’re done with
that, I’ll jump back to the Hangout, and we can take any
live questions that we have. So the first one here, let me
refresh to make sure that we have the most up to date. OK. So “is there a time frame for
adding the rest of the UI app widgets to the GUI builder? Thanks for addressing my
question on September 6. Sorry I missed the live Hangout
by a few minutes.” Said I’d look into it and
provide feedback. So that’s right. I did. And I don’t have concrete
feedback yet. One question I got in response
was, which specific widgets would be most useful to you? Are there certain ones, like a
small subset of ones that you are looking for specifically
to be in GUI builder? Or do you really just want
everything that’s available in UI app to be there in
the GUI builder? Knowing specific ones that would
be the most valuable will help us prioritize. But again, I don’t have any
concrete information on when/if we’ll be adding all the
UI apps to the GUI builder at this time. But I will continue to check
on that, and I’ll update if we have more. ARUN NAGARAJAN: Are you sharing
the screen still? JAN KLEINERT: I am, yes. So yes, hopefully everybody
can see this. And the link to the Moderator
questions is also available from the Google Developers– sorry,
developers.google.com/live from the entry there. It should be embedded
in the page. Second question is
on triggers. So “I keep running into
situations where I wish I could immediately trigger a
script, maybe by SMS or on receipt of an email. One minute triggers won’t
work for this use case. Is there a workaround, or does
Google plan on providing a live event trigger or even
a post trigger?” So this is a really
good question. For those of you who aren’t
familiar with triggers, triggers are basically a way
to execute an Apps Script function after some sort
of event happens. So it could be a time-based
trigger, where you have this trigger run every
five minutes. So that would be a clock-based
event. Or in the case of Google
Spreadsheets, we do have some of these event-based triggers. So when a Google Spreadsheets
form is submitted or when a spreadsheet is opened or when
a spreadsheet is edited, it can fire off an event as well. Outside of Google Spreadsheets,
we don’t currently have product-based
event triggers. But it sounds like
that is something that this poster wants. So what would be really helpful
here is in the issue tracker to raise a feature
request for us with the specific types of event
triggers that you’re looking for. What are the ones that would
help you be able to do the use cases that you can’t
currently do today? We are looking into the
possibility of adding additional event triggers. But I don’t have specifics on
which ones, when, that sort of thing right now. But it’s always helpful for us
to know what it is that you want the most. So do let us now in the issue
tracker for that. OK, the third one here–
“display of data in a UI.” And I’m assuming– it looks like this is a question
related to UI App. So it’s not a problem for data
with multiple records at once. So you can use a grid or
FlexTable for that. But “how to display data where
you only want to see one record at a time with buttons
for next, back, first, last to click through the records?” Well, off the top of my head, I
don’t think we have a built in UI app widget that will
do this for you. I can visualize in my head what
you’re talking about. It’s the kind of– almost like a record in a
database viewer kind of thing. I don’t think there’s
a built-in one supported by UI App. So I think if you wanted
something like this, you would probably have to build
it yourself. So you could have a panel
in the center that would pull in the– a panel with labels, maybe, that
would pull in the data that you want to display for
each individual record. And then you could
hook up buttons. So you could hook up a button
for next that calls a function, that loads the next
record and refreshes the panel and the data. And the same thing for back
and first and last. So we don’t have something out
of the box, I don’t think, that will do this for you. But you could build something
that would do that. Let’s see. And I’m just going to jump over
and make sure we’re not getting any follow-ups
in the chat window. Looks like we’re not. So “for a spreadsheet cell, what
is the best way to test if the value is a hyperlink?” So
I went ahead and put a link in the response here. If I’m understanding the
question correctly, you have a spreadsheet where some of the
cell values may be hyperlinks. And you want to be able to
determine which ones and then do something based on that. So from your script, you
could pull in the values of the cells. And then what I think would
probably be the simplest would be to basically run a regular
expression, run a matcher against that, and determine if
the value in that cell matches a URL format. It’s actually kind of tricky
to build a good regular expression for validating
URLs. But here’s an article I just ran
across that had some tips for, depending on how complete
and how fancy you want to get, some different ways
to build URL regular expression matchers. So hopefully that’s helpful. And then this last question
here. “Is there an easy to access the Google Drive API,
not the Doc list default services from App Script?” OK,
so “URL fetch OAuth config doesn’t work because Drive API
requires OAuth2.” And I think we may have Yan on the
live Hangout here. So related to that, is this
the Drive SDK that you’re looking for? So this is the API for actually
integrating a web app with Google Drive. If you can hear me and you’re
there, you can type into the chat window if you– here we go. We’ve got some typing
going on. So more or less, yes. So if it requires OAuth2, too
and I think you’re correct that our current OAuth support
is not supporting OAuth2 yet, that may not be possible
at this time. I will go back and check with
the team to see if there’s a workaround for that. But I think that if they only
support OAuth2, it may not be possible yet. So I will verify that
and let you know. I’ll update this Moderator entry
so that you can have a solid answer. We do know that there are lots
of use cases out there where we need OAuth2 support. So that something that’s on
our road map that we’re working towards. But we don’t have the OAuth2
support in Apps Script yet. Any other questions from
our live Hangout participants today? Turn off screensharing
for now. No questions? OK. Well, our usual–
oh, here we go. We have– so Yan is talking about
the API from developers.google.com/drive. Let me just click over and take
a quick look at that. Yeah, so that is right. That is the Drive SDK. And I don’t believe it’s
possible to interact with that from Apps Script today. We have been getting
requests for it. So I’ll follow up with the
team and find out what’s required basically on our side
to make that possible from within Apps Script. And I’ll update on the
issue tracker. But yeah, hopefully, that’s at
least helpful to know you’re not doing it wrong. It’s just not supported yet. So I was going to mention Eric
and Ikai, who are often here for Office Hours, are in Austin,
Texas today because we’re having an Apps Script
hackathon there. So I’m hoping that next week,
we’ll have some exciting apps and scripts to tell you about
that were built at the hackathon, once we hear
how all of that went. So here’s a question from one
of our Hangout attendees. So “can the content service do
OAuth authentication?” So I was speaking with somebody else
about this last week. So do you mean kind of like
inbound OAuth so that basically you can use this as
a web service, basically? And for those of you who
aren’t familiar with– yeah, who aren’t familiar with
content service, it allows you to serve up text formatted– so instead of using UI App
or HTML service to serve web-based content, it can
serve up like RSS, JSON, things like that. And so no, today it’s not
possible to support OAuth. So, for example, if you wanted
to have it accessing data of some– maybe Twitter’s API or
something like that, we don’t support that OAuth flow for
content service yet today. But we know there’s
a need for it. Our engineering team is aware. And they’re looking into
possibilities for the easiest way to support that. So I believe there is
a feature request in the tracker for that. If there’s not, go ahead
and add one in. And I’ll hook it up
with our kind of internal tracking process. So that we can keep you aware
of the progress on that. OK. And any other questions? I am looking forward to when
we have that available for content service. Because there’s a lot of really
cool things that you can do once we have
support for that. OK. Let me go just check back
on the Moderator page one more time. See if anything new came in. Nope. Well, in that case, we
may have a very short Office Hours today. I won’t– MALE SPEAKER: Well, I could
throw a question in, Jan. JAN KLEINERT: OK, sure. MALE SPEAKER: Yeah? JAN KLEINERT: Yeah, go ahead. MALE SPEAKER: So I published
a [AUDIO LOST]. One of the things that I’ve
noticed is once I installed it in the Chrome Web Store,
is the icon that came is the Apps icon. Is there a [AUDIO LOST] that published to the
Chrome Web Store can customize that icon? JAN KLEINERT: Yes. So that is something that we’re
currently working on. The support for that is
pretty limited today. There is a complex way that
I can follow up with. It’s complicated. There’s a complicated way you
can kind of get the manifesto. So what we’re trying to do with
the Chrome Web Store is make it simple for you so that
you don’t have to build the manifest file and the zip
package that you have to upload to the Chrome
Web Store. However, we didn’t at launch
support a way to customize the icon that gets installed
on the new tab page. And that’s I think the
issue that you had. Because yes, it’s obviously
a better– MALE SPEAKER: Yep. JAN KLEINERT: –experience if
you can have the proper branding for your app with
your own icon there. So that is something we are
definitely planning to add. But in the meantime, I can
explain a workaround, a way for you to kind of get that
manifest file and the assets that you need to then repackage
the zip file and upload to your Chrome
Web Store listing in the developer dashboard. So I’m trying to think where
is the best place for me to put this information. Maybe what I’ll do is I’ll
post something to the Moderator page later
with instructions on how to do that. MALE SPEAKER: OK. JAN KLEINERT: OK? MALE SPEAKER: OK. Or do you want me to– or would you rather a Stack
Overflow question? JAN KLEINERT: Either
way is fine. I’m going to just put it on the
Moderator page since it’s within the context of this
Office Hours today. And it’s messy. So until we have the proper
support built in, I’ll just explain it here. And it will hopefully give
you what you need, but not be too complex. MALE SPEAKER: Oh, OK. And I guess one of the other
questions that I’ve noticed [AUDIO LOST] and getting some really
interesting things happening with that. I saw in the issue tracker,
I just wondered is there– is it [AUDIO LOST] or is it just sort of thing– what I did, for example, I wrote
just a simple little script account of all
the [AUDIO LOST] in there. And sometimes it would come back
with four and come back with 55 where I knew there were
55 objects in the store. And I thought refreshing my
browser, doing that sort of thing, didn’t seem to fix it. But I would log out,
come back later. And it would [AUDIO LOST] times. My impression was, because the
object sort of came back, that it was the integrity or some
sort of connection issue. Do you have any– JAN KLEINERT: Any
updates on it? So yes. MALE SPEAKER: Yeah,
any updates or– JAN KLEINERT: Yeah. And the audio was kind
of going in and out. I think I got the gist of
what you were saying. I’m going to kind of repeat
it back to make sure. So there is a script DB issue
happening right now. It doesn’t seem to be happening
in all cases. But what you’re experiencing,
where you know there’s X number of items in the database,
but when you do a query, you’re getting Y back. And even that may not be
consistent from, for example, if you access the web app from
the dev URL versus the published version URL. The engineers are working
hard to figure this one out right now. It seems to be– I don’t want to speculate too
much, but it’s not that the data is not there. You’re just getting inconsistent
views of the data in certain cases. And we’re working
really hard to– MALE SPEAKER: That’s
my impression. JAN KLEINERT: Yes. Because it’s obviously not how
it’s supposed to be working. So that is a serious
bug that they’re looking into right now. And we hope to have a solution
for that soon. As soon as we do, I’ll update
the issue tracker and let you all know. But we can definitely reproduce
it, and the engineers are on it. I was talking to them about
it this morning. So they’re trying to fix
it as soon as possible. Any other questions? Comments? Things you want to talk about? OK. Well, in that case, thank
you all for attending. And I think we’ll just go
ahead and wrap up early. And we’ll see you hopefully
next week. All right. Thank you, everybody. Bye.

, , , , ,

Post navigation

9 thoughts on “Apps Script Office Hours – September 13, 2012

Leave a Reply

Your email address will not be published. Required fields are marked *