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

110
Views
Issues with google

Is it possible, depending on the environment of the company, that some features of Google are non-existent? I tried some functions with my personal email and it works; but, in a professional environment it doesn't work.

function getDataForSearch() {

  const ss = SpreadsheetApp.getActiveSpreadsheet();
  const ws = ss.getSheetByName("PEP FORMULAR");
  return ws.getRange(6, 1, ws.getLastRow()-1, 6).getValues();
  
}

var data;

function setDataForSearch(){

      
        google.script.run.withSuccessHandler(function(dataReturned){
          data = dataReturned.slice();
        }).getDataForSearch();
        

      }
      
      function search(){

        var searchInput = document.getElementById("searchInput").value.toString().toLowerCase().trim();
        var searchWords = searchInput.split(/\s+/);
        //var searchColumns = [0,1,2,3,4,5];
        var searchColumns = [0];
        //and

        var resultsArray = searchInput == "" ? [] : data.filter(function(r){

          return searchWords.every(function(word){
            return searchColumns.some(function(colIndex){
              return r[colIndex].toString().toLowerCase().indexOf(word) != -1;
            });
          });
    
        });

        var searchResultsBox =  document.getElementById("searchResults");
        var templateBox = document.getElementById("rowTemplate");
        var template = templateBox.content;

        searchResultsBox.innerHTML = "";

        resultsArray.forEach(function(r){

          var tr = template.cloneNode(true);
          var typeInitiativeColumn = tr.querySelector(".type-initiative");
          var pepRefColumn = tr.querySelector(".pep-ref");
          var projectNameColumn = tr.querySelector(".project-name");

          pepRefColumn.textContent = r[0];
          typeInitiativeColumn.textContent = r[2];
          projectNameColumn.textContent = r[5];
          searchResultsBox.appendChild(tr);

        });

      }

This code works but, when I try to reproduce it in a professional environment, the function setDataForSerach() is not able to get the data from the function getDataForSearch() and make a copy.

about 4 years ago · Juan Pablo Isaza
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!