Add Custom Menu - Google Sheets User Interface (UI) Apps Script Series Part 1

Поделиться
HTML-код
  • Опубликовано: 11 сен 2024

Комментарии • 72

  • @CopaceticAtay
    @CopaceticAtay 4 года назад +27

    Dude, You're easier to understand than all of the professors I had back when I was in college for a comp sci degree.

  • @playlists9782
    @playlists9782 3 месяца назад

    Very efficient and clear descriptions. That you often also identify and explain common issues, and likely potential modifications to the code in your videos, is also very helpful. Nice work.

  • @punyhuman5405
    @punyhuman5405 2 года назад

    This deserves way more likes, so easy to understand, great work.

  • @santosahernandezmendoza7147
    @santosahernandezmendoza7147 5 лет назад +2

    Another brick in Google Apps programming
    Thank you!

  • @Sulaimangalib
    @Sulaimangalib 4 года назад +2

    You are the BOSS!
    I've learned from you a lot. Thanks

  • @menafady5338
    @menafady5338 4 года назад +5

    Hello great man! greetings from Italy! i used the quarantain to learn about AppScripts from you and i want to thank you.
    i got a question: how can i run the same script on bulk of spreadsheets in the same folder?
    thank you again!

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  4 года назад +5

      This should help you ruclips.net/video/tmKqry4EKdQ/видео.html

  • @daniduasatu
    @daniduasatu 8 месяцев назад

    You're a life saver thankyou!

  • @filobonda
    @filobonda 4 года назад +1

    Nice beginner video, thank you! Do you have videos about add-on creation for google sheets? I'd especially be interested in understanding the whole publishing process step-by-step for a public add-on, as this is truly a pain.

  • @luqmansecond6375
    @luqmansecond6375 3 года назад +1

    I tried sharing the Google sheet with the custom menu I have created with other users but they are unable to see the custom menu. Any way to make it visible to them?

  • @patrickm9953
    @patrickm9953 4 года назад +2

    Your videos are great, I wish you had a github repo with your source in it for reference.

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  4 года назад +3

      Takes too much time to manage these. I have to pick my battles.

  • @iputuardisupartawan1392
    @iputuardisupartawan1392 3 года назад

    Cool... you are the best...

  • @arabiancorner3110
    @arabiancorner3110 5 лет назад

    Great Videos I must say , well elaborated .

  • @wartable
    @wartable Год назад

    Nice video...any way to modify the existing bar? Like adding + / - on the Font Size so one does not have to open a drop down and select size but rather just hit a plus or minus button?

  • @j53iliff2
    @j53iliff2 4 года назад

    Keep rocking!

  • @khemrajrana7322
    @khemrajrana7322 5 лет назад

    Nice sir

  • @BarakAlmog
    @BarakAlmog 3 года назад

    Amazing! Thanks for these

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  3 года назад +1

      Glad you like them!

    • @BarakAlmog
      @BarakAlmog 3 года назад

      @@ExcelGoogleSheets I binged them:) Quite versed on coding of all kinds, so they're a bit slow for me, but I could easily skip to the important stuff. I imagine this series is a godsend for beginners. All power to you bro! Tnks again.

  • @ishwaryasingavarapu9488
    @ishwaryasingavarapu9488 4 года назад +2

    Hi sir, I copied exactly what u do but there is an error: cannot call SpreadsheetApp. getUi() from this context. (Line 2,file) . What should I do?

    • @cwoods1132
      @cwoods1132 4 года назад

      I'm getting the same error. I've checked my work a number of times. Was there an update?

    • @cwoods1132
      @cwoods1132 4 года назад

      I found it on Google's development page: developers.google.com/apps-script/guides/menus
      Otherwise, here's the code Google provides that worked for me:
      function onOpen() {
      var ui = SpreadsheetApp.getUi();
      // Or DocumentApp or FormApp.
      ui.createMenu('Custom Menu')
      .addItem('First item', 'menuItem1')
      .addSeparator()
      .addSubMenu(ui.createMenu('Sub-menu')
      .addItem('Second item', 'menuItem2'))
      .addToUi();
      } //end onOpen() function//
      function menuItem1() {
      SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
      .alert('You clicked the first menu item!');
      } //end menuItem1() function//
      function menuItem2() {
      SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
      .alert('You clicked the second menu item!');
      } //end menuItem2() function//

  • @LungosBoy
    @LungosBoy 2 года назад

    Hi The script editor is not anymore existing under Tools menu of the google sheet...how can we add script editor to make a menu?

  • @SubscribersThunai
    @SubscribersThunai 5 лет назад

    Thanks a lot

  • @coeag
    @coeag 3 года назад

    Hi, thanks for this interesting video. Is there a way to create a gui interface (perhaps using html code) and show it to the user to capture info and write that info into some sheets cell ?

  • @pichit.raetai
    @pichit.raetai 5 лет назад

    Thank you

  • @ShekiMetica
    @ShekiMetica 4 года назад

    It it possible to add links to certain sheets or tabs within the same sheet) in the custom menu? I can't seem to figure this out :(

  • @bekindhavepassion3649
    @bekindhavepassion3649 2 года назад

    Hello! Can you help with this issue? To create dynamic menu (items) from google sheets rows by using apps script. For example, when a range of rows is changed so the menu items are changed as well. Thank you.

  • @hungrydaze
    @hungrydaze 5 лет назад

    thank You !!!

  • @mathiasmugoni6877
    @mathiasmugoni6877 Год назад

    How do you add those icons that appear on the function's caption

  • @alexphillips5187
    @alexphillips5187 3 года назад

    Having serious problems adding a custom menu. Have tried multiple ways then tried yours and it still is failing at some point with no indication of where. If you or any one in the comments is willing to help, I'd love the help.

  • @j53iliff2
    @j53iliff2 4 года назад

    Hey LGS, is there a way to simply open an already existing menu item using Action Script?

  • @marcosrs75
    @marcosrs75 2 года назад

    Since there is no need to declare a variable for a menu anymore, are you thinking about revisiting the subject and creating a new video sometime? I've been trying to create a menu with some submenus and I've been having difficulties, mainly because I can't copy your code anymore :( Thanks

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  2 года назад

      Nothing changed in the way the code works. I've just made one yesterday.

    • @marcosrs75
      @marcosrs75 2 года назад

      "How to add an icon" to menus will be nice as well :)

  • @hongminhle5429
    @hongminhle5429 4 года назад

    Hi there! If my function its parameter how could I put it into addItem :( ?

  • @moldovaflag8209
    @moldovaflag8209 3 года назад

    Have got an Error:
    Error
    Exception: Cannot call SpreadsheetApp.getUi() from this context.

  • @richardsanglayluna4345
    @richardsanglayluna4345 3 года назад

    function initMenu() {
    var udi = SpreadsheetApp.getUi();
    var menu = udi.createMenu("Classes");
    menu.addItem("7A-7b", "sevenA");
    menu.addToUi;

    }
    function onOpen(){
    initMenu();
    }
    function sevenA() {
    SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().getRange("a1").setValue(new Date())
    }
    I tried to follow the syntax of your code, but the new menu doesn't come out, is there any wrong with my code?

  • @bigmancozmo
    @bigmancozmo 4 года назад

    pls help im getting an error that says "TypeError: Cannot read property 'getActiveSheet' of null (line 3 file "Code")"
    Edit wait nvm i just needed to rewatch the tutorial

  • @eiger67
    @eiger67 5 лет назад

    Hi sir, hello followers, i found an issue by the onOpen event. If you declare GLOBAL variables that, in my case, refer to another spreadsheet, the event onOpen doesn't build your custom menu.
    Your script will still work and your custom menu will be built if you run the script from the script editor.
    Solution:
    1) Avoid GLOBAL variables in your script file.
    2) Build the men running the script from the script editor (make less sense).
    3) Create an Textbox or Image in the sheet and assign it the script that build the menu, in this case make also no sense to call the script onOpen.
    Did someone had the same issue like me?
    Hope this was helpful
    Have a nice day

  • @karthiprem
    @karthiprem 3 года назад

    can we create custom menu of a sheet with other sheets' appscript?

    • @karthiprem
      @karthiprem 3 года назад

      i have 2 sheets but i need a custom menu in the other sheet

  • @quanghanguyen4803
    @quanghanguyen4803 4 года назад

    I want to make a form of website to login as admin, or login as staff.
    -Admin can edit staff.
    -After logining: Multiple staffs can edit, view, update in the same time in the page like google sheet.
    -After staffs access and edit, data auto saved in files and we can print it normally.
    So what series can figure it? Need someone helps

  • @ZzTonyJaazZ
    @ZzTonyJaazZ 5 лет назад

    Could you please make more tutorial videos about App Scripts

    • @stmsolution
      @stmsolution 4 года назад

      Look it ruclips.net/p/PLlHR3f8sb05B9n0jnXgS3yxn2CTQ3XOGS

  • @barefacedquestions
    @barefacedquestions 4 года назад

    Is there any way to put a checkmark in front of a menu item to indicate that it's been clicked?

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  4 года назад

      No.

    • @barefacedquestions
      @barefacedquestions 4 года назад

      @@ExcelGoogleSheets Thanks for the reply :). What would you recommend for handling the UI of time-based triggers then? I'm coding a menu item that when clicked, will trigger a time-based triggers. This seems suboptimal because I can accidentally click it a second, or third time, and end up with a lot of unwanted triggers.

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  4 года назад

      @@barefacedquestions Open a sidebar and have your clickable buttons in the sidebar, where you can control their behavior.

  • @nickieoakwood6926
    @nickieoakwood6926 4 года назад

    Do things up date that quick? New sheet. New script. Copy exactly what you do and get ReferenceError: date is not defined (line 3, file "code"). Also what cannot call spreadsheet from this Ui even mean? If the spreadsheet is open in te next tab then surely te ActiveSheet should mean that.

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  4 года назад

      UI means user interface. Everything is case sensitive, so Date NOT date

    • @bodinej.g.m.beentjes3773
      @bodinej.g.m.beentjes3773 4 года назад

      i'm getting the same problem, how do i solve the reference error. I tried both "date" and "Date"

  • @robertmaluka2763
    @robertmaluka2763 2 года назад

    Google changed the " to '. Had a problem with it at first.

  • @farinabodrum9893
    @farinabodrum9893 2 года назад

    Can you add UI and have certain shared users who only have read access to be able to edit certain cells in a UI created by a script? I am really lazy to do a whole python app for this please someone say yes.

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  2 года назад

      If you needs a truly secure system use something with user authentication built in, like python django.

    • @evrenbingol7785
      @evrenbingol7785 2 года назад

      @@ExcelGoogleSheets I was worrying about that. once i go down that path it ia going to be crazy as it has to be multitenant as well. Ok thanks

  • @spectromasoffice5423
    @spectromasoffice5423 4 года назад +1

    // thank you
    function initMenu(){

    //This is where we acces the UI
    var ui = SpreadsheetApp.getUi();

    //create our main menu
    var menu = ui.createMenu("My Macros");

    //add regular items to our main menu
    menu.addItem("My Time Macro", "myMacro");
    menu.addItem("Another One", "myMacro");
    menu.addSeparator();
    menu.addItem("Third One", "myMacro");
    menu.addSeparator();

    //create a submenu ad add it to our main menu
    var submenu = ui.createMenu("Special Functions");
    submenu.addItem("Show The Box", "showMessage");
    submenu.addItem("Same Date Function", "myMacro");
    menu.addSubMenu(submenu);

    //create another submenu ad add it to our main menu
    var submenu2 = ui.createMenu("Special Functions");
    submenu2.addItem("Show The Box", "showMessage");
    submenu2.addItem("Same Date Function", "myMacro");
    menu.addSubMenu(submenu2);

    //render all of the above
    menu.addToUi();


    }
    function onOpen(){
    initMenu();
    }

    function myMacro() {
    SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().getRange("a1").setValue(new Date());

    }
    function showMessage(){
    SpreadsheetApp.getUi().prompt("You did it!");
    }

    • @yukinoryu
      @yukinoryu 4 года назад

      Finally someone with a brain!

  • @koungsareth8623
    @koungsareth8623 3 года назад

    Please, create complete manu

  • @wolfdevscubical1260
    @wolfdevscubical1260 4 года назад +1

    Does not work.

  • @origami_canoe1952
    @origami_canoe1952 4 года назад

    main manu

  • @paulloup5210
    @paulloup5210 5 лет назад

    thank You !!!