I am using paid google suite. Have created a google sheet and a script to be used with that sheet that uses Language.translate.
I am trying to run the script but it says
"Service invoked too many times for one day: translate".
How can I solve this problem. Paying for the service is no problem. Just need clean instructions.
Thanks in advance.
I haven't done this myself, but I believe you have to open the Google Cloud Platform project associated with your script (Resources > Cloud Platform project), enable the Translate API there and setup a billing account for this project.
I'm not sure if the Apps Script built-in Translate API interface, LanguageApp will work out of the box with this setup or if you'll have to switch to manual UrlFetch invocation of the API. My guess is that the built-in will work, but it isn't hard to switch either.
Anyways, your calls to Translate API should then be enabled and cost $20 per 1 million characters translated.
Related
I created a small app on top of a spreadsheet (with GAS and HTML, CSS) and I deployed it.
Users can access to it without having to enter in the spreadsheet.
It works really well but i'm not able to see even the basic analytics (for eg. the number of viewers)
Thanks
Go to the project overview page. In the Google Apps Script web IDE, on the lefmost sidepanel click on Overview.
Also, if you have starred your project, go to https://script.google.com/home/starred
Rather than "viewers" you will see "users". If you have set your web-app as execute as you by anyone even anonymous, you will see only one user, you, as this page show the users that exectuted the scripts like the doGet function and the server-side functions called through google.script.run.
Note: https://script.google.com keep execution logs for the last 7 days. If you need to keep the logs longer you have to use another place to keep these logs, i.e. Cloud Logging (requires a Google Cloud standard project), Google Sheets spreadsheet.
Resources
https://developers.google.com/apps-script/guides/logging
Related
Effective way to debug a Google Apps Script Web App
Google Apps Script project (more about this here)
Create script at script.new
Menu Publish -> deploy as a web app
Here you choose performed by me, user, etc. Accessed by ...
Is it possible to make it work with a service account as its owner? (so that it survives when you terminate the user's accounts later)
I would check out this awesome article stepping through the step-by-step approach to allow Google Apps Script to use a service account. This might work for your needs.
How to use GCP service accounts with Google Apps Script projects
One thing to note is that the Google Apps Script API itself does not work with service accounts. As per the documentation.
Hope this helps! Let me know if you need further assistance :)
I have scripts that I made with Google script editor. Basically what my scripts do is make and change google SpreadSheets, Slides, and Docs. It is logical that Google puts a limit on the amount of computing that you can do. The error that I get is this:
Error in Apps Script executions Overview
My question is how can I bring my scripts to Google Cloud Platform and pay for the computing power? So that I can finish my work. I am not sure where to start in the Google Cloud Platform. Or can I use my own computer as computing power?
Any Help, tips, or tricks are welcome, 😅 Thank you 🙏
Google Apps Scripts are already part of your default project in Google Cloud Platform, and it is GCP that manages your quota for services and API's that are being executed in those scripts.
Please check your codes, identify areas in which there are a lot of API executions, and try to optimize, for example, removing API calls within loops, etc. Here is a reference of quotas that are managed in GCP for Apps Script:
Quotas for Google Services
If the code is already optimized, then you can apply for increased quota here:
Monitor API Quotas
I'm working with apps script and the plivo api (https://www.plivo.com/docs/sms/api/message#list-all-messages). I'd like to be able to use the plivo node sdk (https://www.plivo.com/docs/sdk/server/node-sdk/) inside apps script. Is there a way to install this or use this from github or some other source directly?
Answer
In a summary you can't install or use plivo by using Apps Script.
You can use your own libraries or a shared library. Third party (external and not shared) libraries in Google Apps Script are not allowed directly.
As per the Google Apps Script documentation says Google Apps Script is a rapid application development platform that makes it fast and easy to create business applications that integrate with G Suite. Apps Script goal is mainly interact with other Google Services/APIs.
Why using third party libraries is not allowed/recommended?
It's possible to use the eval and UrlFetchApp.fetch() function in order to get the content of a specific JS and execute it like:
eval(UrlFetchApp.fetch('http://URL/javascript.js').getContentText());
However, it's adding more computing time when it comes to run an Apps Script and depending on your kind of user there's a limit to successfully execute a script.
External services like plivo or another VOIP services are not allowed due to the reasons I mentioned above. As a workaround I'd suggest to take a look into GCP products like App Engine or Compute Engine and make use of your third party library from there.
I'd like to reuse a Google Apps Script between multiple sheets on my personal Google account without publishing the script publicaly. One approach that I'm trying to avoid is to simply copy and paste the script between each sheet that I'm using.
After some reading my impression is that this is typically done by publishing an add-on. I am also under the impression that this can (or could) be done privately, so that no code review is needed and you don't need to pay anything. Most of the related questions I've found on SO seem to have out of date answers (chrome web store instead of GSuite Marketplace) or are too simple (share by publishing an add-on) or refer to gsuite users/admin, etc.
Assuming I need to publish an add-on to get easy sharing across all of my sheets I'm told I need to convert my project to a Google Cloud Project. So I created a Google Cloud Project and then went to transfer my code to that project by going to "Resources - Cloud Platform project" and entering my project number. However, when I do that it tells me that I need to enable oauth for the project and it takes me to a page which looks like it will require formal code review.
I am under the impression that private publishing may be possible if I am an organization. So I went back to the Google Cloud Console and tried to create an organization. Here however, it seems like either I need to be subscribing to GSuite or I need to enable Cloud Identity. The latter seems only pertinent to businesses as during the sign up it asks me for my business name and business domain (e.g. jims-business.com); I stopped when it asked me for my domain.
So again, my question is, is it possible to share a Google script between multiple sheets on my personal account without making a public add-on? After way to much time reading through Google terminology my impression is no, but I'd be happy to be proven wrong!
You don't need to be a G Suite user to publish an add-on, but you do if you want to do it as "internal only", as it requires a valid domain.
I'm afraid you will have to copy the same Script for each file and use an onOpen function.