We can’t currently access or manipulate any items in a live Google Form, with Google Apps Script, as the user is filling it out. Only the Google Form builder can be programatically controlled. A script can either help build a form before it’s opened or be setup to trigger a function to run after a response has been submitted. See quickstart for working with Google Form responses and the Add-on example for the Google Form builder.
To dynamically show form items or change input values as users are filling it out:
- Build and deploy your own web app that acts like a form with HtmlService ( hosted on script.google.com )
- Build a regular HTML form hosted on your own service.