Programmatically Generate a Google Sheets Table of Contents

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

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

  • @emmatejada7762
    @emmatejada7762 14 дней назад

    I'm following along and running the script to the point you have covered at time marker 8:05. I'm getting "TypeError: Cannot read properties of undefined (reading 'getName')". Can someone help me understand what this means and how to fix it?

    • @emmatejada7762
      @emmatejada7762 14 дней назад +1

      Ah, at line five I had
      for (i=1 ; 1

  • @omargarcia2806
    @omargarcia2806 8 месяцев назад +1

    Super useful video. Thanks a lot!

  • @0000000demo
    @0000000demo 2 года назад +3

    The video shows how to create a script to make a table of links to specific sheet in sheets. Very helpful for large groups of sheets. I'd suggest taking it a step further and adding a link to each page or menu item that takes the user back to the index. Also, could you consider adding the index to a dropdown in the menu bar? Good presentation. Thank you.

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

      Ah yes, so much more we could do to spruce things up a bit more. Maybe this video warrants a part 2... 🤔
      Thanks for the suggestion!

    • @SteBor-bb1st
      @SteBor-bb1st 10 месяцев назад

      @@BootstrappingTools Did you record a part 2 to this one?

  • @Twogemsconsulting
    @Twogemsconsulting 8 месяцев назад +1

    This is clearly essential for huge sets of worksheets, however, the page link approach can be much faster for navigating small number of pages. for a small number of tabs under, say 15-20 or so it is faster to link to pages or cells directly, but once coded you can reuse the code.
    And agree it's best to create a link back to your guide or ToC page on each sheet.

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

    Sorry - I know this video is older, but I just tried the script to generate a TOC, and the script is executing just fine in Apps Script and shows me the results I want, but it's not showing up on the Table of Contents tab I created in my Google Sheet workbook. Any suggestions on making it show up there?

  • @shalizashaban
    @shalizashaban 8 дней назад

    For some reason, I am getting "Formula parse error" for all tab links... how do I solve that?

  • @MelissaFinch-k2m
    @MelissaFinch-k2m Год назад +1

    When I did this it asked me for permission and I said yes but now it is saying access denied and I do not have permission to view the info

    • @BootstrappingTools
      @BootstrappingTools  11 месяцев назад

      Do you have edit rights to the google sheet you're trying to use this on?

    • @JohnHeineke
      @JohnHeineke 5 месяцев назад

      @@BootstrappingTools I just ran this as well and it is telling me the same thing. I am the owner of the sheet and I'm logged into the proper account. Any idea why it's saying I need to request access to my own sheet?

  • @42Pandas
    @42Pandas 2 года назад +1

    Script editor isn't under the tools menu?

  • @42Pandas
    @42Pandas 2 года назад +6

    function generateTOC() {
    var ss= SpreadsheetApp.getActiveSpreadsheet();
    var sheets = ss.getSheets();
    var sheet_names =[]
    for (i=0; i < sheets.length; i++) {
    var url = "insert your spreadsheet link here" + sheets[i].getSheetId();
    var formula = '=HYPERLINK("' + url + '", "Link to Tab")'
    sheet_names.push([sheets[i].getName(), formula])
    }
    console.log("sheet_names: ", sheet_names)
    var toc_sheet = ss.getSheetByName("Contents");
    var toc_range = toc_sheet.getRange(1,1, sheet_names.length, sheet_names[0].length)
    toc_range.setValues(sheet_names)
    }