Possible to pre-assign user to google form?

╄→гoц情女王★ 提交于 2019-12-11 05:58:09

问题


I am creating a Google Form dynamically, and emailing it, using Google Apps Script.

I have all the users info, and have figured out how to record the response. However, I would like to add that person's email to the row in the sheet.

It would be ideal if there was a way, since we already collected their email, to pass this email in the "background" to the form we send, and it is attached with there answer in the responses sheet.

Thanks!


回答1:


I was not able to rest until I got this worked out. This article from almost three years ago really helped.

Not exactly what I was going for, still open if anyone knows how to actually pass info in the background to a sheet.

var items = formName.getItems();
var itemOfInterest;
for(var i in items){
  if(items[i].getTitle()=='QUESTION_TITLE'){
    itemOfInterest=items[i];
  }
}
var preFilledUrl =
    schedForm.createResponse().
withItemResponse(itemOfInterest.asTextItem().createResponse(email)).
toPrefilledUrl();

This prefills that question box, so also giving the user the ability to edit before they send. It'll work.



来源:https://stackoverflow.com/questions/39940488/possible-to-pre-assign-user-to-google-form

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!