why I can't call onFormSubmit() in Google App Script after form submission finish on my Google Form Project

31 views
Skip to first unread message

Tien Do

unread,
Jun 13, 2024, 1:30:10 AM (13 days ago) Jun 13
to Google Apps Script Community
I am going to implement Google App Script in another user's Google Form.
So now I am developing Google App Script and that script is in Google Standard Cloud Project with my Google Cloud account.
I created my credentials in this Google Cloud Project and enabled necessary APIs for my app script project.(Google Form API, Google Drive API, App Script API, Google Sheets API).
And I added scopes that my script will request.
In this situation, I made a code like this.

function onFormSubmit(e) {
  var formResponses = e.values;
  Logger.log('Form submitted with responses: ' + formResponses);
}

function createFormSubmitTrigger() {
  var form = FormApp.openById('YOUR_FORM_ID');
  ScriptApp.newTrigger('onFormSubmit')
           .forForm(form)
           .onFormSubmit()
           .create();
}

I ran createFormSubmitTrigger() and it runs. On Triggers of Script Editor, i found this trigger that  will call the onFormSubmit function whenever the form is submitted.
so I submited forms in my Google Form's Preview, and I returned Execution Logs. But there is no change in my Logs. I want to know the reason. If you don't mind, I hope you would help me and give me solution. Thank you for your attention.
Best Regards,
D.V.Tien

Reply all
Reply to author
Forward
0 new messages