Created
July 24, 2020 00:58
-
-
Save kaycebasques/dd3a6788c6dd7f30fabc4b6c460d4dab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// After exporting Google Analytics data from Google Sheets, | |
// I used this function to convert the paths to hyperlinks. | |
function myFunction() { | |
const spreadsheet = SpreadsheetApp.openById('ID_HERE'); | |
const data = spreadsheet.getSheetByName('NAME_HERE'); | |
// You'll want to update the range. | |
const range = data.getRange('A2:A1561'); | |
const paths = range.getValues(); | |
const values = []; | |
paths.forEach(path => { | |
// You'll want to update the links | |
values.push([`=HYPERLINK("https://developers.google.com${path[0]}", "${path[0]}")`]); | |
}); | |
range.setValues(values); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment