Home > Software design >  Appscript to get hyperlink to another google sheet
Appscript to get hyperlink to another google sheet

Time:04-03

I am looking for a code that will help me to find the hyperlink of another google sheet on my google drive, everything i have read explains how to get the link for the active sheet..

any ideas?

Thanks a lot

CodePudding user response:

You need to use DriveApp with functions getFilesByName or getFilesByType. Then provide file id to SpreadsheetApp.openById.

CodePudding user response:

This look will give you the hyperlink to every sheet in a spreadsheet

SpreadsheetApp.openById(file.getId()).getSheets().forEach(s =>
      tree.txt.push([ `=HYPERLINK("https://docs.google.com/spreadsheets/d/${file.getId()}/edit#gid=${s.getSheetId()}","${s.getName()}")`]));

It generates a column. It's just a fragment of a piece of code

  • Related