Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

107
Views
Calling a function inside Code.gs in Google App Script?

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
almost 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!