I want to pre-fill a Google form such that some of the fields which are pre-filled, are the responses from another form. What i mean to say is that i send out a few columns of the responses of one of my forms and get the information validated by a third party. Is this kind of pre-filling possible?
Asked
Active
Viewed 1,036 times
0
-
1Start with this answer to a similar question: http://stackoverflow.com/questions/20108511/is-it-possible-to-prefill-a-google-form-using-data-from-a-google-spreadsheet/20110656#20110656. – Mogsdad Nov 28 '13 at 19:59
1 Answers
0
function sendForm(e) {
//Code to open second form and get the items of the form
var form = FormApp.openById('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
var items = form.getItems();
var formItem = items[0].asTextItem();
var formResponse = form.createResponse();
var count=0;
var response = formItem.createResponse(e.namedValues["Name"].toString());
formResponse.withItemResponse(response);
formItem = items[1].asTextItem();
response = formItem.createResponse(e.namedValues["Email"].toString());
formResponse.withItemResponse(response);
//Creates URL with pre-filled data
var url = formResponse.toPrefilledUrl();
//Mail the link to the people required.
}
This code goes in the response sheet of the first form and a trigger must be added to call this function every time a form submit action happens.

Kira
- 955
- 1
- 11
- 25