pythongoogle-sheetsgoogle-apps-script

Creating buttons in Google Sheets like EXCEL


My question is quite simple but I can't figure it out. How can I create buttons in Google Sheets which can be seen when logged in. I want to initialize the script upon logging into the spreadsheet rather than going to load manually. Is there a way to do that? Also I couldn't find the nice tutorial which gives the intermediate knowledge about the Google Sheets function. All I could find was this simple tutorial.

Another question is: Can the Python script as provided by Google Apps Script be saved and executed in Google Sheets itself? If it could, it can provide more functionality than simple Google Apps Script functions.


Solution

  • You can create some UI elements using Google Apps Script.

    https://developers.google.com/apps-script/guide_user_interfaces

    Apps Script is javascript-like script that runs SERVER side, in google land. It has access to various services and google document model. But is otherwise restricted from many things that you'd think javascript can do. This is the root of most of its limitations. You can enable a script to load on start-up and hook into related events.

    While there is Python and Java API to access Google Docs and their content, there is no way to to create the UI elements outside of Apps Script and the related UI Designer: http://googleappsdeveloper.blogspot.com/2011/06/building-ui-in-apps-script-just-got.html