I have a google script WebApp with the link for example
https://script.google.com/a/macros/domain.com/s/******/dev?v=repDetails
On the users side - in HTML code - can I get the "v" value? I've tried to search similar issues and developed this
var getUrlParameter = function getUrlParameter(sParam) {
var sPageURL = ScriptApp.getService().getUrl()
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]);
}
}
};
var id = getUrlParameter('v');
alert(id)
but it returns an error "ScriptApp is not defined"
Any solution here?
Thanks