Search code examples
google-sheets

GSheet: Include multiple hyperlinks in 1 cell when using importrange?


I have two sheets (sheetA & sheetB).

In sheetA, there is a column for links. Some cells have multiple links. When I use import range, the hyperlink disappears. Please see these Google Sheets (sheetA & sheetB) as a detailed example. Is it possible to include multple hyperlinks when using an import range? Any advice appreciated. Thanks.

Customer Device(s) Links
Ken Le iPhone XR Apple Store (hyperlink working)
Ron Smith Pixel 7 Google Store (hyperlink working)
Pauline Lam iPhone 13 and Pixel 8 Pro Apple Store and Google Store (hyperlink not working)

Solution

  • Possible Limitation:

    I stumbled upon a post from google community with the same issue as yours and it seems that this is a possible limitation to the function IMPORTRANGE when importing a cell with multiple links.

    Suggestion:

    You can try this custom menu that I created which triggers an Apps Script and copy the data from your sheetA to sheetB with the links and format

    Script:

    function onOpen() {
      var ui = SpreadsheetApp.getUi();
      // Or DocumentApp or FormApp.
      ui.createMenu('Custom Menu')
          .addItem('Import Data', 'customImport')
          .addToUi();
    }
    
    
    function customImport() {
      var sourceUrl = "Insert sheetA URL here"
      var source = SpreadsheetApp.openByUrl(sourceUrl);
      var dest = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
      var range = source.getDataRange().getRichTextValues();
      dest.getRange(1, 1, range.length, range[0].length).setRichTextValues(range)
    
    }
    

    Output:

    image

    References:

    getRichTextValues

    Custom Menus in Google Workspace