how to create a google form response with app script -


as way of initializing form record, want fill , submit google form apps script. key bit of documentation form.createresponse() this

creates new response form. answer question item, create itemresponse item, attach form response calling formresponse.withitemresponse(response). save assembled response, call formresponse.submit().

do need new formresponse() or how make happen?

create new form

    var test_form = formapp.create('test1');     test_form.addtextitem(); 

get first question text item

    var questions = test_form.getitems();     var qt = questions[0].astextitem(); 

set response

    var qr = qt.createresponse('cats'); 

create , submit response object

    var formresponse = test_form.createresponse();     formresponse.withitemresponse( qr );     formresponse.submit(); 

Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -