I've use Google Apps Script before, but haven't bene programming for oabout a year now.
For a new project I would like to know if I should continue using Google Apps script or switch to HTMLService.
So first question is if Google Apps Script still is and well be supported by Google.
Second question is what are the main differences between HTMLService and Google Apps Script that make it worth switching.
If you mean should you use HTMLService or UIService within Google Apps Script, it would probably be best to use HTMLService as UIService is deprecated.
UIService will appear in auto-complete until 30th June, but not after.
https://developers.google.com/apps-script/sunset?utm_campaign=htmlser-1214&utm_source=gadbc&utm_medium=blog
http://googleappsdeveloper.blogspot.co.uk/2014/12/speeding-up-htmlservice.html
https://developers.google.com/apps-script/guides/html/
For first Question: Yes, The Google app script used to make google products as custom like google spread sheet , google docs and we can insert the script into google sites so that we can share output through website.
For second Question: In Google app script the ClassUIApp is deprecated in that place we can using HTML services
https://developers.google.com/apps-script/reference/ui/ui-app
In the beginning Google App Script, all the code was written in one file one with .gs extension which included the code for User Interface, styling and business logic which made it complex as the application moved from small scale to enterprise level.
Also there was a restriction that you have to use the UI components from App Script (UiApp) which was not welcomed by the existing community of web developers as it was limited and needed to be learned and could not offer all the features a programmer may require.
Therefore in order to make it popular among existing community of developers App Script gave the ability of writing HTML pages as part of the project which was very helpful as it is widely used for designing all kinds of UI.
So, as you can see here that Google has made a shift, and hence HTMLservice is the future.
Google Apps Script was design for interact with google apps, so, if you are working with google drive, calendar, maps. You must use apps script, It's is easy and fast to implement.
But if you don't need use Google Apps may be is better use another software because how I told you before, Apps Script was created for interact with Google Apps and works awesome.
Google say: "The HTML service lets you serve web pages that can interact with server-side Apps Script functions. It is particularly useful for building web apps or adding custom user interfaces in Google Docs, Sheets, and Forms. You can even use it to generate the body of an email."
https://developers.google.com/apps-script/guides/html/
The purpose is different, what do you want to do?
Been following updates from Google in regard to GAS for over 6 months now. Google is putting a lot of resource into GAS and I don't think there should be any concern about it being deprecated.
And HTMLService is a class that can be called from inside the script editor so I don't know why one would need to choose one or the other.
Just go into the script editor and press control + space bar at the same time and you'll see all the classes available to you in alphabetical order. Scroll down to H and you'll see HTMLService. I haven't used it yet but it's there to work with.
HTMLService is a service to serve HTML pages through Google Apps Script. You can use HtmlService as a normal web page.
Related
Requirement: Auto-generation and completion of a Google doc based on selections made by filtering options in Google sheets
Step-by-step:
There are x options listed in a spreadsheet.
I reduce them to the number I need via filtering.
I then have these options + the expanded details automatically added to a google doc template I've designed.
As an unexperienced programmer, it's very likely that the most convenient way to do something like this is by using Google Apps Script as it has services that help to extend Google Sheets and Google Docs among other Google apps. This service use JavaScript as programming language and it's possible to create and manage the script by using a web browser.
Experienced programmers that don't want to invest too much time on doing this might also find convenient to use Google Apps Script, but they might prefer to use the tools used for other projects might use CLASP or the Google Apps Script API.
Besides using Google Apps Script this could be done by using Google Docs API, Google Sheets API, Google Drive API and Google Cloud.
I have to do a little bit of "crowdsourcing" for my work and it would consist in a very simple web app where a user can register/log in, and then be taken to a page where a picture is shown to a user and submit a number.
I'd like to be able to set up a few rules to choose which picture the user will see (so he won't have to answer twice the same question and also to allow some overlap between users to compare their answers).
We can assume that I have a google sheet with a list of images URLs that can be accessed and that I would like the answers to be populated there.
I figured that this tutorial would be a good start since it handles user creation and management and user can submit ideas :
Creating a CRUD Web App with Google Sheets
That being said I'm a bit clueless, I've tried to look for sample scripts deployed as web app but it's hard to know where to start.
I'll appreciate any help !
Google Apps Script is, basically, a javascript environment with a set of libraries that interact with the Google Apps. For instance, to read or store information from/to Google Sheets or Google Docs. If you know javascript, you can create simple applications there. In addition, you can create plugins for Google Applications if you are interested.
A very simple example
Suppose you wanna display an HTML page. You can create an stand-alone script (an script not-bound to a G suite application) and use the content or the HTML services.
You can create a function that sends a simple message to the browser using the ContentService:
function doGet() {
return ContentService.createTextOutput('Hello, world!');
}
Or you can create a function that sends an HTML file in the same project using the HtmlService:
function doGet() {
return HtmlService.createHtmlOutputFromFile('Index');
}
Once you have created the function, you must deploy the script as a web application.
Save the script as a new version doing File > Manage Versions and Save new version.
Then, publish the app using Publish > Deploy as web app and provinding information about the permissions for the application.
After Google publishes the application, it gives you an URL to access the application,
You may check more in a simple tutorial on producing content with Google Apps Script. In addition, you may check the google guide to use the HtmlService to provide templated content, i.e. where the HTML are templates which data is provided by javascript functions and variables.
Getting started with Google Apps Script
To start, you may check some tutorials in the internet:
Google has some tutorials and a series of Youtube videos.
In addition, you may find multiple resources for Google App Scripts that may help you:
Google has a list of sample projects
Tanakeich has a list of resources for taking advantage of Google Apps Script.
Oshliaer has another list of resources.
There are Google Codelab (tutorials) for Apps Scripts. They include a lab for using Google Sheets as a reporting tool and for creating a Hangouts Chat bot with Apps Script
Developing Google Apps Script projects locally
Although Google Apps Script provides a web interface to create your applications (your scripts), a better idea may be to create the software locally, using more-traditional tools for Javascript.
Clasp is a command-line tool to develop locally Google Apps Script projects.
Google has a codelab that teach you how to use clasp.
I'm deploying an aplicattion in Google Apps Script, and I need the implementation of a captcha on it, how can I include captcha in Google App Script?
Know it's an old question, but had the same issue recently.
In short, Yes, and you can add reCaptcha.
See the readme and sample files and then adapt to your needs.
Code.gs has the basics you need to only have to use javascript as oppose to php for responses.
Yes, you can.
Here is a tutorial I posted today on my website.
reCAPCHA with Google Apps Script
The tricky thing is the domain name when you register for a Website to use reCAPTCHA. Since Apps Script webapps are hosted in an iFrame, you need to use domain of iFrame. If you do an analysis of Apps Script Webapp, you will find that all the apps have an iFrame on a temporary domain like xsdsdfjsdfks.googleusercontent.com. So you need to resgister domain googleusercontent.com in order to get a site-key and secret-key pair.
I am considering using Google Spreadsheets and Google Apps Scripts for our business rules, given that Spreadsheets will make the business rules available and editable to non-technical employees.
My concern is about all the quotas that apply to Google Apps Scripts, as these also might change in the future, and there is no way to upgrade to a "premium" with more liberal quotas.
As a fall-back I am considering using the Google Spreadsheets API, and I assume that there are also quotas on this API, but I cannot find them anywhere. Does anyone know them? Or has anyone hit these quotas?
I am also trying to get some sort of idea of whether it is indeed a good idea to put the business rules in Google Spreadsheets in my question here.
There is an Apps Script Dashboard which identifies any service disruptions, as well as a tab for a breakdown of quotas, based on your Google Apps account type.
Google Apps Script Dashboard
From a quick skim of your posting on StackExchange, one thing to be mindful of is the email quota (1500 total recipients per account each day). You may be able to offset this hurdle (if applicable) using Google Groups, either by creating predefined groups, or programmatically building groups using Advanced Google service in Apps Script (at least for internal communications; direct add accounts for external addresses require a welcome message).
I'm not familiar with Ultradox, but using Apps Script, you can populate Google Doc "Template" files, convert them to PDF, and attach in Gmail (or provide the share link), right from Apps Script.
So I know that it's possible to create scripts for use on spreadsheets using Google Apps Script, but is there support for using created scripts on documents? I know that the API provides services for creating and editing documents, though they bear the experimental tag, but I can't seem to find a way to create and install a script on a document.
And when I say document services, I refer to the following link: https://developers.google.com/apps-script/service_document
Update: you can do this now. Just in case someone stumbles on this answer. To clarify the above answer, too: you can create scripts that are attached to documents or standalone scripts. Attached scripts can be published as add-ons, but are always associated with a document (doc, sheet, or form). Standalone scripts can be published as web apps.
You can't find it because you cannot do it. Scripts can indeed manipulate documents using Document services (as you referred to) but the script itself should be linked to a spreadsheet or a Google site. Linked is probably not the best word since the apps script can be published to work as a standalone web application - in this case the link to the spreadsheet is used only during the development of your application.
I hope this makes things clear enough.