Home > database >  Get specific row value(or values) from a spreadsheet in bound google app script
Get specific row value(or values) from a spreadsheet in bound google app script

Time:10-04

I'm a beginner in Google Apps Script and I'm trying to write a script for the following use case.

There's a set of values in spreadsheet, i'd like to execute the google apps script(bound script) by using the function name and pass the row values as input parameter (attaching screenshot)

Screenshot of the spreadsheet

I was able to write a script by fetching one value from the row, but when the columns increased, I was unable to use the 'input' in script.

Here's the script I used for getting one value.

function testfunction(input) {
  return input * 100;
}

How can I modify this to get more than one column value (for the above table from screenshot) and use it for calculation.

CodePudding user response:

The following is how you would code it. This is the basics of javascript as Google apps script uses javascript as the main programming language. Depending on the number of arguments you would like to add in, you increase the number of parameters in the parentheses.

function testfunction(input1,input2) {
  return input1 * 100   input2 * 100;
}
  • Related