I have an app-maker server-side script that I would like to be able to call from the client script, or from code in a Google Sheet. Is this possible? If not, what would be the best way to create code that can be called from an app maker client or a google sheet?
Related
I have a Google Colab Workbook that does some scrapping and saves the scrapped files in my Google Drive and I also have a Google App Script that manipulates these files in Google Spreadsheet.
Is there a way to trigger this Google App Script directly from Google Colab? So at the end of my scrapping it does all the things I need it to do, without the need to open Google Apps Script.
I know I could write code in Google Colab that does exactly what the Google App Script does. But I would like to avoid that.
You might use Google Apps Script to create a web-app or you might use the Google Apps Script API then call them from Google Colaboratory by doing a HTTP request. The method to be called to execute a Google Apps Script function is script.run.
Related
python requests POST with header and parameters
How to make a Post request to an API using Google Colab
Resources
https://developers.google.com/apps-script/api/quickstart/python
https://developers.google.com/apps-script/api/how-tos/execute#python
I have a google apps spreadsheet, and I want to write a script that can be accessed via any browser, will generate a response using data from the spreadsheet, and return it to the browser.
I put in a lot of data in the spreadsheet that is required for my app. I want to automate the process of getting the data from the spreadsheet and integrating into the app before creating a build. Right now I run the script manually, download the result, and copy it into the app's data folder.
Ideas?
You can interact with your script via HTTP Post
doPost Trigger
Here is a little example of a doPost function
function doPost(e){
return ContentService.createTextOutput(SpreadsheetApp.openById(id).getSheetByName(name).getDataRange().getValues())
}
I am planning to use Google sheet API v4 in my website .
I have custom form, I want the data of form to dumbed in Google sheet
I don't have any servers like Python, Apache, etc., in my host server
You may follow this SO thread on how to get the data in forms using Forms Service. Also check on this Spreadsheet Service on how to modify the spreadsheet using apps script. Then you can publish the script as a web app if the function returns an HTML service HtmlOutput object or a ontent service TextOutput object.
Here are the following tutorials which might help:
Saving Form Data to Google Spreadsheets Using PHP and the Google Docs API
Google Sheets as a Database – INSERT with Apps Script using POST/GET methods (with ajax example)
I have Google spreadsheet with script attached to it (with the Tools->Script Editor tool).
I want to call one of script function from external Android App. Is it possible? Should I use Spreadsheet API?
Unfortunately, you cannot directly call your script from any external application.
However, you can change it to be a web application, then invoke it via an HTTP GET or POST from almost anywhere, including an Android app.
Insert new rows into Google Spreadsheet via cURL/PHP - HOW? provides an example of a web app that you could adapt.
Should I use Spreadsheet API?
Your question doesn't actually say what it is you want to do, so the answer is "it depends". You still won't be able to invoke an embedded script using the Spreadsheet API, but you will be able to read and write spreadsheet content.
Obviously the answer depends on your usecases, but have you checked the Google Appscript API?
As stated it
provides methods to remotely execute Apps Script functions
I have been looking for a way to interact with my google sheets (and other services) from Excel (and other desktop applications).
For example:
I get a report from a work system and my boss asks me to update the information in the google sheets so that our site is up to date with the latest information.
What would be great (and easy for me) would be to use a VBA script in my spreadsheet to turn all my data in http requests and then do the heavy lifting with Google Apps Script in the cloud and finally updating the Google Sheets with the associated API.
When I look at the oAuth2 playground I can't find a way to enable Google Apps script, as I have successfully done so with other APIs.
(to be clear, I don't want to do oAuth2 with in GAS - which is a lot of the other questions that get raised)
Is this a hard problem or is there a solution?
There is currently no way of calling a Google Apps Script from an external program. You do have a few other options:
Import the relevant data into Google Sheets manually and use Google Apps Script to process it as needed, possibly making use of time-based triggers to handle the processing automatically.
Use the Google Spreadsheets API. Unlike Apps Script, this API is built to be called from other programs and can manipulate Google Sheets. However, it is a bit more difficult to use than Apps Script. Once data has been moved into a Google Sheet, a separate Apps Script can be used to manipulate it.