Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

google sheet custom menu function not visible in google sheet on android

I created in google sheets a custom menu linked to a custom function that pops up a dialog window with a youtube video in it. All this i did on my PC in a browser.

I now installed google sheets on my android phone, and shared the sheet myself (using a second gmail account). I now notice that the custom menu doesn't appear in google sheets app on android.

I am wondering, does custom menus and dialogs work in google sheets on android. Am i doing something incorrect in relation to permissions -- i.e. are there any permissions i need to assign to other users for them to see and use custom menu items and related functions. If yes, how can i make the correct settings.

thank you,

Dan

like image 391
user2193970 Avatar asked Jun 06 '18 19:06

user2193970


People also ask

Where is the menu on Google Sheets app?

The menu at the top of the window in Google Sheets contains access to many of the tools and settings that you will use to customize your spreadsheets. Above this menu is the file name, as well as options to “Star” the file, or move it to a different location within your Google Drive.

Why is Script editor not showing in Google Sheets?

If the Tools --> Script Editor and the Add-ons menu options are missing when you open the file, it probably isn't actually a Google Sheets file. Make sure to navigate to File --> Save As Google Sheets. Then the Script Editor option in the Tools menu and the Add-ons menu will be available.

How do I create a custom menu in Google Sheets?

In Google Sheets, select the menu item Extensions > Apps Script to create a script that is bound to the spreadsheet. Delete any code in the script editor and paste in the code below. Return to Sheets and insert an image or drawing by selecting Insert > Image or Insert > Drawing.


1 Answers

i used a drop-down list/combo - populated using data validation. this is supported on mobile device. then i use the onEdit(e) event to trigger the code... the first step is to identify what's been edited (which cell) and then act accordingly... an example follows where the drop-down would contain two items "Do Task 1" and "Do Task 2"... the event is triggered when any cell on the sheet is changed... the process then identifies if the cell change is that of the drop-down (cell value set to a global variable 'FunctionsCell') if it is the drop-down that triggered the event, it then gets the value (see the 'getValue()' part of the code) and then inspects it's value and then executes the code accordingly (see '// do something part')

var FunctionsCell = "B2"  // global

function onEdit(e) {

var editCell = e.range.getA1Notation()

switch (editCell) {
case FunctionsCell:
  {               
      var functionType = SpreadsheetApp.getActiveSheet().getRange(FunctionsCell).getValue()

      switch(functionType) {              
        case "Do Task 1": {
          // do something
          break
        }
        case "Do Task 2": {
          // do something
          break
        }
      }
  }
  }
}
like image 165
Ronnie C Avatar answered Nov 10 '22 11:11

Ronnie C