Created
April 6, 2022 10:21
-
-
Save jlhernando/bbadf8fb606e2bc13d8ee6512cd4d0a2 to your computer and use it in GitHub Desktop.
Decode URLs in Google Sheets creating a custom fucntion in Apps Script
This file contains hidden or 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
/* Both these funcitons will work fine */ | |
// As a function declaration | |
function DECODE(url) { | |
return decodeURI(url) | |
} | |
// Or as an arrow function | |
const DECODEURL = (url) => decodeURI(url) | |
Just to make the above clear, the function needs to use decodeURIComponent (not decodeURI), so the code should be...
// As a function declaration
function DECODE(url) {
return decodeURIComponent(url)
}
// Or as an arrow function
const DECODEURL = (url) => decodeURIComponent(url)
Thanks @jlhernando for sharing this originally, and @campiotto for your correction 👍🏼
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This worked best for me thanks @jlhernando
/* Both these funcitons will work fine */
// As a function declaration
function DECODE(url) {
return decodeURIComponent(url)
}
// Or as an arrow function
const DECODEURL = (url) => decodeURIComponent(url)