Basically, I have a javaScript.html file enclosed with a script tag that is embedded to my Index.html using <'?!= include('javaScript'); ?> without the " ' " before the <.
What I am trying to do is call function globalVariables, located on my Code.gs, inside my javaScript.html but whenever I want to access isEditor's value, I always get an error of "Uncaught ReferenceError: globalVariables is not defined"
Code I want to access in Code.gs
function globalVariables(){
var varArray = {
//Other items here
isEditor: true
};
return varArray;
}
Code in my javaScript.html that needs to access globalVariables
function createTable(dataArray) {
google.script.run.globalVariables();
var data = globalVariables().varArray[6].value;
var isEditor = data;
if(isEditor == true){
//other code here