Tanvi Shah
Tanvi Shah

Reputation: 11

How to invoke Python script from google apps script

I have a small Google apps script which is invoked with an onClick event to retrieve the last row added. Next step is I need the apps script to invoke a python script internally. Is there a way to do that? I am new to Apps script so any help is appreciated. Thank you in advance

Upvotes: 0

Views: 274

Answers (1)

Narendra
Narendra

Reputation: 382

Google Apps Script is quite similar to JavaScript itself. So, can you execute python inside JS code. I guess no.

A way that I can think of exposing that python code via Ajax Call. You can invoke the URL from the Apps Script. REST APIs come in handy to break the boundaries of languages.

But yeah, in this approach you do need to host an API. I do that using Google Cloud Functions which are really brilliant where building an API in python/nodejs is quick and easy(few minutes) with a ready HTTPS URL.

Upvotes: 2

Related Questions