Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

I'm writing a script to automate data entry for google forms using a google sheet.

function auto_data() {

var formURL="https://docs.google.com/forms/d/e/1FAIpQLSfB4NZHDqagGZDSyAmn0prmCThgRgp44ED7TsQDbrdvPCL9-A/viewform?usp=sf_link";

var wrkBk = SpreadsheetApp.getActiveSpreadsheet();
var wrkSht = wrkBk.getSheetByName("Sheet1");

var stunumber = wrkSht.getRange("A2").getValue();
var firstn = wrkSht.getRange("B2").getValue();
var lastn = wrkSht.getRange("C2").getValue();
var cohort = wrkSht.getRange("D2").getValue();
var teacher = wrkSht.getRange("E2").getValue();

var datamap = {"entry.1349037061":stunumber,
"entry.115259800":firstn,
"entry.1390558599":lastn,
"entry.245609341":cohort,
"entry.1444620207":teacher};

var options = {
"method": "post",
"payload" : datamap
};

UrlFetchApp.fetch (formURL,options);
}

------------------------------------------------------------------------

when executing the script, I receive this error message:

Exception: Request failed for https://docs.google.com returned code 405. Truncated server response: <!DOCTYPE html>

Does anyone know how to solve this error? it was working fine last night :(

1 answer

0 votes
Hana Kučerová Community Leader Nov 26, 2020

Hi @methuna thayalan ,

welcome to the Atlassian Community!

Error 405 means "Method Not Allowed" - it is not possible to send POST request to the url provided in the script.

I think you are not using correct url. According to the article, it should probably look like this:

https://docs.google.com/forms/d/e/1FAIpQLSfB4NZHDqagGZDSyAmn0prmCThgRgp44ED7TsQDbrdvPCL9-A/formResponse

But please be aware I didn't test it.

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you