I receive the error message "invalid url" with the instruction openByUrl(url) when I try to assign the url a value from an array passed from another workbook. let url = array[20]. The logged result of array[20] is the working url I want. I tried passing it without quotes, with single and double quotes, but no luck. If I hardcode the url in the script as let agentcrmUrl = "https://ift.tt/jQhsYD4......", all works fine. Thanks for any help!
profile.forEach(function(agent,index,array) { //arrary from another workbook
Logger.log(agent[4]);
Logger.log(agent[20]); //pasted logged result in browser works fine
let agentcrmUrl = agent[20]; //passed with/without single and double quotes
let responses16Sheet = SpreadsheetApp.openByUrl(agentcrmUrl).getSheetByName("Form Responses 16");
let responses16 = responses16Sheet.getDataRange().getValues();
Searched solutions online.
Via Active questions tagged javascript - Stack Overflow https://ift.tt/E9hzFAM
Comments
Post a Comment