Copy paste the script into the console of the submission flow of Google Looker. It's a Google Form, so might work for other Google Forms as well.
Enjoy!
| // Fill in these two variables for every new deployment | |
| const deploymentId = "..."; | |
| const whatChanged = "We ..."; | |
| // Fill in these fields once | |
| const fields = [ | |
| { | |
| name: "Connector name", | |
| value: "xxx", | |
| }, | |
| { | |
| name: "Apps Script deployment ID", | |
| value: deploymentId, | |
| }, | |
| { | |
| name: "Contact email", | |
| value: "xxx@xxx", | |
| }, | |
| { | |
| name: "Link to the Apps Script project", | |
| value: | |
| "https://script.google.com/home/projects/xxx/edit", | |
| }, | |
| { | |
| name: "Test configuration", | |
| value: | |
| "Use this configuration to test our connector.\n\nEnter the hostname of your website: xxx\nEnter the API key of Simple Analytics: sa_api_key_xxx\nSelect time zone you want to use in your exports: Any timezone is okay", | |
| }, | |
| { | |
| name: "Exception for urlFetchWhitelist", | |
| value: "Not applicable.", | |
| }, | |
| { | |
| name: "Additional comments", | |
| value: whatChanged, | |
| }, | |
| ]; | |
| for (const field of fields) { | |
| const element = document.querySelector( | |
| `div[data-params*="${field.name}"] input, div[data-params*="${field.name}"] textarea` | |
| ); | |
| if (!element) throw new Error(`Could not find input for ${field.name}!`); | |
| element.value = field.value; | |
| element.dispatchEvent(new Event("input", { bubbles: true })); | |
| } |