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

70
Visualizações
Send value to Google Sheets via web app with formula in variable

I'm using a web app to send data to Google Sheets via Apps Script. I'm using 'appendrow' to post several variables. Everything works fine but one variable is a number, call it 'Amount'. I found out that I can type a Google Sheets type formula in my web app such as '=10-5', '=10*2', '=10/2' and when it gets posted to my Google Sheets it provides the expected result. Good! However, if I type '=10+5', I get an error in my Google Sheets. When I look at the formula bar, it shows '10 5'. Why does it not show the formula as '=10+5'? The previous examples that I gave all show the expected formula in the formula bar.

function doGet(e) {

  // I cannot take credit for this script. I copied and modified it from another user.

  
  var ss = SpreadsheetApp.openById("FILE ID GOES HERE")
  var sh = ss.getSheetByName("Register"); //sheet name is 'Register'

  var date = e.parameter.date;
  e.parameter.date = '1/2/2023'
  var amount = e.parameter.amount;
  var paytype = e.parameter.paytype;
  var payid = e.parameter.payid;
  var maincat = e.parameter.maincat;
  var subcat = e.parameter.subcat;
  var explanation = e.parameter.explanation;

  sh.appendRow([date, amount, paytype, payid, maincat, subcat, 
  explanation]);

}

So when data get passed to Google Sheets via the sh.appendRow, the amount always works correctly when it contains, for example:

'10.52', '=10-5', '=10*2', '=10/2', but not '=10+5'. Instead, I get '10 5' and shows an error in the spreadsheet cell.

You may have guessed that I am a novice when it comes to script.

Thank you for any ideas.

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