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.
Related
Question:
Can I add the authorization part of my google sheets add-on into my add-on's code or does it need to be a separate thing? What would that code look like? If adding the authorization process into the google app script isn't an option, what would be the next best option and what would that look like?
Premise:
I'm very new to coding or working with an API, google app script, and google cloud platform. I have looked over Google's documentation a dozen times and I'm still unsure how to actually implement the authorization process. Using the HTTP/REST option looks like the best option but I'm really not sure. I've gotten the clientID, secret, URI, etc... that would be required but I don't know where I put that information. Does the code need to be on my website? If so, what would that look like or where can I go to learn more about it?
Thank you in advance!
Approach
When using Apps Script you won't need to insert your credentials anywhere. The Auth flow is managed by the Apps Script environment. Every time you will need extra permissions to run your script, the environment will prompt for your authorization. This will generally require a normal login to the google account you want to use to authorize your script.
Using Google APIs on Apps Script can be done using two different patterns:
Pattern 1: Built-in Google Services
You can use the Apps Script scaffold G Suite Apps classes to work on G Suite Documents, Sheets, Forms, Slides and more. This will feel like programming with native classes and interfaces than using an over-the-internet API.
Pattern 2: Advanced Google Services
Advanced services are essentially thin wrappers around the Google APIs. They You must enable an advanced service before you can use it in a script. To enable the Advanced Services visit the guide here
References:
Built-in Google Services
Advanced Google Services
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.
I want to use the Research tool in Google Docs as apart of my app script, is there a way to call it in my script?
As far as I can tell from the Google App Scripts documentation, this is not possible. You might want to submit a feature request to Google to add this functionality (new issue button is on the left of the linked page, it's hard to see).
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.
Can we write our front end design and use the google spreadsheet for the back-end for a website?
Thank You
Google Apps Script might also be a good option for you. You can host your code on the Google servers (all written in JavaScript) with easy access to all the spreadsheet and docs APIs. You can see a lot of tutorials on the site.
Another even simpler option might be Google Forms - if you are just trying to gather some data and record it in the spreadsheet.
You have probably already found an answer or a workaround, but here is an example from Google.
https://developers.google.com/apps-script/storing_data_spreadsheets