Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

89
Visualizações
importdata undefined within googlescript

I have a Google Sheet where I am tracking various asset prices including crypto. The easiest way to get crypto prices is by importing from cryptocurrencies.cc:

=importdata("https://cryptoprices.cc/AION/");

However, now my spreadheet is full of references to the cryptoprices.cc website. If it ever goes down or changes domain, I would have to replace the URL everywhere in my sheet, which is quite uncontrolled. So I thought about making a wrapper function:

function cryptofinance(token) {
   return importdata("https://cryptoprices.cc/"+ token);
}

This returns an #Error! however: ReferenceError: importdata is not defined (line 94). I am assuming that you cannot call Google Sheet functions outside of the context of the Sheets cells, correct?

If not, what is the proper way to call importdata from within this function? If yes, then what is the best alternative to retrieve the same information using javascript?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You cant use importdata like a formula at this place. first you need to get cell refernce then you need to put formula inside the setvalue() function;

var currentCell = SpreadsheetApp.getCurrentCell(); // Select cell here 
currentCell.setValue('=importdata("https://cryptoprices.cc/"+ token)');

for select a range of cells you can use getRange() function

SpreadsheetApp.getRange(row,col).setValue('=importdata("https://cryptoprices.cc/AION/")');

change row, col with cells range.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda