AppsScriptPulse

Community Tip: Restrict a Google Form to Your Domain with Apps Script

How to publish a Google Form so that it can only be completed by people in your domain.

Screenshot of code for publishing a Google Form

Screenshot of code for publishing a Google Form

This was developed in anticipation of the changes from 31 March 2026 with the Forms API.

In a helpful post on “The Gift of Script,” Phil Bainbridge tackles the common need to publish a Google Form so it can only be completed by users within your organisation.

He shares the complete Apps Script snippet, highlighting the crucial (and often missed) step of first setting the form as published (.setPublished(true)) before using the Drive API to apply domain-wide “reader” permissions. It’s a quick, effective solution for securing internal-only forms.

Source: The Gift of Script: Publish a Google Form to your domain

Leave a Reply

Your email address will not be published. Required fields are marked *