Skip to content

Instantly share code, notes, and snippets.

@adriaandotcom
Created February 6, 2023 05:25
Show Gist options
  • Save adriaandotcom/2a0ccac947a8a867003b45e2fb402d12 to your computer and use it in GitHub Desktop.
Save adriaandotcom/2a0ccac947a8a867003b45e2fb402d12 to your computer and use it in GitHub Desktop.
Google Looker submission script

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 }));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment