Created
October 23, 2025 08:38
-
-
Save phillypb/3bc35a5123d4e01745911ca9aa87a5fc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Code for: Publish a Google Form to your domain | |
| * | |
| * DEVELOPED BY THE GIFT OF SCRIPT: https://www.pbainbridge.co.uk/ | |
| */ | |
| function setAnyoneInDomain() { | |
| // Form ID | |
| var formId = "YOUR FORM ID HERE"; | |
| // Publish the Form | |
| FormApp.openById(formId).setPublished(true); | |
| // set Form permissions for Drive API | |
| var options = { | |
| domain: "YOUR DOMAIN HERE", | |
| type: "domain", | |
| role: "reader", | |
| view: "published", | |
| }; | |
| // optional argument for Shared drives | |
| var optionalArgs = { | |
| supportsAllDrives: true | |
| }; | |
| // create the permissions | |
| Drive.Permissions.create(options, formId, optionalArgs); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment