0
    function doGet(e){
handleFunction(e);

}

function doPost(e){
handleFunction(e);

}



function handleFunction(request){



var name = request.parameter.name;

var number = request.parameter.number;
var ss =    SpreadsheetApp.openByUrl("https://docs.google.com/spreadsheets/d/1afoMQY/edd=0");



 var sheet = ss.getSheetByName('South Clubhouse');
  var rowContent = sheet.appendRow([name,number]);
}

I tried running it through postman several times I doesn't work. The params aren't working. What should I do to make it work properly?

1
  • Your code did work for me when I tested it. Could you provide more information? Which line is causing this issue? Because the line "11" has nothing on it. Commented Mar 10, 2020 at 11:13

1 Answer 1

2

doPost and doGet deals with payload in different ways.

function doGet(e){
  var data = e.parameter;
  handleFunction(data);
}

function doPost(e){
  var data = e.parameter.data
  handleFunction(data);
}

function handleFunction(data){
  var name = data.name;
  var number = data.number;
  var ss =   
    SpreadsheetApp.openByUrl("https://docs.google.com/spreadsheets/d/1afoMQY/edd=0");
  var sheet = ss.getSheetByName('South Clubhouse');
  sheet.appendRow([name,number]);
}
Sign up to request clarification or add additional context in comments.

1 Comment

I don't mean to be argumentative but I don't think that's correct. But I could be wrong.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.