Customize confirmation page after submitting google form - google-apps-script

I have this google form (just using google drive), this is like a test with multiple choices, so the thing is when a user completes the form and clicks on submit button, I want the confirmation page shows the test results.
Is it possible?
I try using creating scripts and using events and triggers, but I'm start to thinking I've misunderstand its usefulness.
Thanks in advance.

Yes, you can create a form with Google Apps Script and show the results at the end. Events and triggers may not be the right way to go, but you can try your hand at UiService with which you can create your forms.

Related

Updating Google Form Drop down values on load

Is there anyway to update drop-down values of some Google Form items when users are loading the form? I know onOpen is just for openning the form in edit mode, but Just wanted to be sure weather is any workaround for this or not? if so, What would be then the alternatives? Using web form for instance, which is totally different approach maybe!?
Thanks,
M

How would I implement for loop using google script to edit a google form?

I am very new to scripting on Google form. In fact, I just recently fount out about it.
So what I'm trying to do is that I want to create a form that consists of duplicated pages in accordance to a number that is chosen by the user.
For instance, the form asks the user "How many people will be participating in this event?" If the user types in 5, the form will make 5 duplicates of a page, in which all of those pages will ask for the details of each participant.
So is there a way create duplicates of a page using a for loop?
First, you'll need to implement using installable form-submit trigger which runs when a user responds to a form.
For more information, check these two versions of the form-submit trigger:
Google Forms events
Google Sheets events
Then, when triggered, you may want to create new documents using the append methods in Class Body.
See this related SO posts for more insights and sample codes:
Duplicating a page of a document and replacing text on each page
Google app script copy document page

How to connect Apps Script to a Google Form submit button?

I have a simple Google-form for registration users on my service and they need to enter time when they will come. Its a problem when they can enter the same time that another user had placed and I need to check it when user push the submit button.
How can I do it with Apps Script? I have found few examples but still dont understand how to connect my script with submitting.
It's not possible to use Apps script to check data entered into a form pre-submission (Even with triggers, which are all dependent on the data being submitted). In order to do something similar using Apps script, you would need to use the HTML service to write a custom form with a function that allows you to check what data is submitted, and return an error message/refuse to accept the date if it clashes with a pre-existing date.
You are essentially trying to do something similar as the choice Eliminator Forms add-on.
Search the documentation for on form submit trigger. And it will give you an example.
But the catch 22 of it, is that your script runs after the form is submitted, so there is no way to stop the submission if it fails your check.

Any way to validate a Google form input?

I want to collect and validate a value (PIN) in a Google Form. The Form has 2 pages, and I'd like the validation to affect form navigation:
If PIN matched with a value in Column N of the response sheet, continue to page 2 of the form
If PIN not matched, Do not continue.
Can this be done with Google Apps Script?
You are not able to create this type of dynamic form using the Google Forms Service, because there is no interaction between the service and scripts during form entry, except upon Form Submission. In the case of a multi-page form, a script has no way to know that a user has completed one page and gone on to another.
You could achieve this using the HtmlService or UiService, by writing your own form.
Not sure you can do this with Google Forms and Apps Script.
But I have done exactly this with UiApp/Html Service in Apps Script. I used it for a light-duty user authentication.

Google Form Confirmation Page with a Button to Create a Report, via Browser Access

I have created a Google Form. From the Confirmation page I would like to create a button that says "See Test Score". At that point I want to create a report of sorts, accessible via a browser, using apps script. The report would access data from a Google Spreadsheet via apps script. I just need to figure out a way to create the report. The report data will mostly be in table format but I may want to add a graph or two. Any help would be appreciated! Thank you!
You cannot do this using a Google Form. However, what you can do is write a UI using Google Apps Script which has the same fields as your form. You can customize this UI a lot more where you can show a report on the confirmation screen etc.
I suggest you go through the Google Apps Script tutorials and start writing your UI. If you get stuck or need help, come back with the issue you're facing