Setting up a Google Form
Setting up a form takes two places: the dashboard, where you choose what iHorizon does with the responses, and Google Forms, where you install the script that sends them. Allow about five minutes.
You need to be the server owner or have Administrator on the server, and to be able to edit the form in Google Forms.
1. Link the form in the dashboard
Open your server in the dashboard, then the Google Forms module (group Community), and click Link a form.
| Field | What it does |
|---|---|
| Name | Shown as the title of each card and in the dashboard. 1 to 64 characters. It doesn't have to match the form's title. |
| Channel | Where iHorizon posts each response (a text or announcement channel). You must be able to see and write in it. Leave it on No card to only collect statistics. |
| Roles to give | Given to the member who answered, if iHorizon finds them. Up to 10 roles, each below your highest role and iHorizon's. Optional. |
| Question that identifies the member | The exact title of the question where people type their Discord username or ID, as written in the form. Needed for the role, and to show the member on the card. |
| Receive responses | On by default. Switched off, iHorizon refuses the responses of this form. |
| Applications (accept or refuse each response) | Optional. Each response waits for a reviewer to accept or refuse it, and the roles are given only on acceptance: see applications. |
Click Save. The form appears in Linked forms, and the script panel opens just above.
Up to 10 forms per server
Each server can link up to 10 forms. Each one has its own channel, roles, secret and statistics.
2. Copy the script
The Install the script panel shows a script made for this form, with its address and its secret already filled in. It guides you in four steps, numbered at its top: Form link, Copy the script, Install in Google, Check. Each step gets a tick once it's done, and the current one is highlighted (on a phone, the steps are listed one under the other).
Shown only once
The script contains your secret and is shown only once. Copy it before closing the panel. If you lose it, you'll have to create a new secret (see below): iHorizon keeps the secret encrypted and can't show it again.
Keep the script private: anyone who has it can send fake responses to your server.
Your form's link
Step 1, Your form's link, is required: until it holds a valid link, the script stays blurred and Copy the script stays greyed out. Paste the address of your form's editor there, or just the form's ID: the script is filled in with your form's ID (the FORM_ID line, line 5), in your browser only. Nothing is sent to iHorizon.
| What you paste | Result |
|---|---|
https://docs.google.com/forms/d/<ID>/edit: the address bar while you edit the form (also with an account number, …/forms/u/1/d/<ID>/edit) |
Form ID added to the script. The script appears. |
The ID alone: the part between /d/ and /edit in that address |
Accepted the same way. |
https://docs.google.com/forms/d/e/<…>/viewform or forms.gle/…: the link you share with members |
Refused: it's the form's public link, a different ID that Apps Script can't open. Open the form in edit mode and copy the address from your browser's address bar. |
| Anything else | Refused: This isn't the link of a Google Forms editor, nor a form ID. |
Once the link is accepted, click Copy the script (step 2). If your browser refuses the copy, select all the code and copy it by hand: the step counts as done too. Changing the link afterwards changes the script: copy it again.
3. Install it
The script runs on Google's side, in Apps Script, in a project of your Google Drive. Paste the script there, run install once, allow access: the install function adds the On form submit trigger by itself, you don't add it by hand.
- Create a project. Click Open script.google.com in step 3 of the panel (or go to script.google.com), signed in with the Google account that owns the form (or can edit it). A new, empty project opens.
- Paste the script in place of the empty
myFunction, then save (the disk icon, or Ctrl+S). You can name the project (for example "iHorizon"): that's the name Google shows in the next step. - Run install. In the bar above the code, choose install in the list next to Run, then click Run.
- Allow access (see below). The execution log then shows
iHorizon is now linked to the form: <your form's title>. Back to the dashboard!
The whole setup in video, step by step (also behind the panel's Video tutorial button):
Allow access
On the first run, Google asks you to choose your account and to allow the script to see your form, to connect to an external service (iHorizon) and to run when you're not there (the trigger). Accept: without this, the script can't run.
Google then shows Google hasn't verified this app: it's your own script, created from your account. Click Advanced, then Go to (your project's name), and allow.
Running install again is safe
install first removes the project's previous On form submit trigger for that form, then adds a new one. Run it again whenever in doubt: you'll never get two cards for one response. You can check the result in the project's Triggers (the clock icon): one line onFormSubmit, event On form submit.
The script only sends the responses sent after it was installed. Older responses stay in Google Forms.
Back in the dashboard, click Done, it's installed under the instructions to finish step 3 (the check sent by install, or a real response, ticks it by itself).
4. Check that it works
The panel's last step, Check, turns green on its own: when install runs, the script sends a signed check to iHorizon (nothing is posted on Discord, nothing is counted), and the panel, which looks for it every few seconds and as soon as you come back to its tab, says The script is linked to your form. Submit it once to see the card on Discord. You can close this panel. No need to reload the page.
Then open your form like a member would and send a response once: the card appears in the channel within a few seconds. A real response also ticks the step, for a script installed before this check existed.
Still nothing after two minutes? The panel says what to look at: the function chosen next to Run must be install, and the execution log says why if iHorizon refused the check (for example a script copied before a new secret: copy it again).
Send a test
Send a test, on your form in the list, checks the Discord side only: the channel and the card. iHorizon builds a fake response and posts it like a real one:
| Message | What it means |
|---|---|
| Test response posted in the channel. | The channel and the bot's permissions are fine. |
| The test reached iHorizon but no card was posted: check that iHorizon can write in the channel. | The bot can't see or write in the channel, or the channel no longer exists. |
| Test received. No channel is set, so no card was posted. | Normal if you chose No card. |
| iHorizon is offline: try again in a moment. | The bot didn't answer. Try again later. |
A test response is marked Test on the card (in yellow), is not counted in the statistics, is not saved in the latest responses, and never gives the role. Its answers are made up by the dashboard, with your own Discord ID as the member answer.
Change a form
Click Edit on a form to change its name, channel, role, member question, or to switch Receive responses off. The changes apply to the next response, and the script doesn't need to change.
While Receive responses is off, the responses sent to the form are refused: they are not posted, not counted, and not sent again when you switch it back on. Google Forms still keeps them.
Create a new secret
Click New secret (and confirm) when you lost the script, or if you think someone else got it. The dashboard shows a new script, with the new secret.
The old script stops working at once: until you replace it with the new script in the same Apps Script project and save, every response of the form is refused. The trigger stays: no need to run install again (doing so is harmless).
Delete a form
Delete (and confirm) removes the link, its secret, its statistics and all its saved responses. It can't be undone. The script left in Apps Script will then be refused: delete its trigger (Triggers, the clock icon), or the whole project.
When nothing arrives
| Situation | What to check |
|---|---|
| No real response ever arrives, but the test works | That you ran install and allowed access (step 3): the project's Triggers must list onFormSubmit, event On form submit. |
| script.google.com is blocked | Apps Script is turned off for your account (a school or work Google Workspace): ask its administrator. |
Paste your form's ID in FORM_ID (line 5), then run install again. |
The FORM_ID line (line 5) doesn't hold a form ID (it was edited by hand, or comes from an older script). Type your form's ID there yourself (the part between /d/ and /edit in the editor's address), save, and run install again; or create a new secret to get a new, filled-in script. |
Exception: No item with the given ID could be found… or You do not have permission… when running install |
Wrong form ID (often the public /forms/d/e/… link instead of the editor link), or the form belongs to another Google account: run the script while signed in with the account that owns the form. |
| It worked, then stopped | Look at the form's Analytics: if responses were refused, it says why. Usually someone clicked New secret (paste the new script), or Receive responses was switched off. |
| Responses are counted but there is no card | The channel: iHorizon needs to see it and send messages in it. Or the bot was offline when they arrived. |
| The card shows "(not found on the server)" | The answer didn't match a member: see how the member is found. |
| The card appears but the role isn't given | See when the role is given. |