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

68
Views
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
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!