---
title: "Community Tip: Restrict a Google Form to Your Domain with Apps Script"
author: "Phil Bainbridge"
date: 2025-10-29T10:37:35+00:00
canonical_url: https://pulse.appsscript.info/p/2025/10/community-tip-restrict-a-google-form-to-your-domain-with-apps-script/
markdown_url: https://pulse.appsscript.info/p/2025/10/community-tip-restrict-a-google-form-to-your-domain-with-apps-script.md
categories:
  - "Beginner"
  - "Forms"
  - "Snippet"
tags:
  - "pbainbridge"
  - "pbainbridge.co.uk"
featured_image: https://pulse.appsscript.info/files/2025/10/ScreenshotofcodeforpublishingaGoogleForm.png
description: "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."
---

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

![Community Tip: Restrict a Google Form to Your Domain with Apps Script](https://pulse.appsscript.info/files/2025/10/ScreenshotofcodeforpublishingaGoogleForm.png)

> How to publish a Google Form so that it can only be completed by people in your domain.
> [https://www.pbainbridge.co.uk/2025/10/publish-google-form-to-your-domain.html](https://www.pbainbridge.co.uk/2025/10/publish-google-form-to-your-domain.html)Screenshot of code for publishing a Google Form
> This was developed in anticipation of the [changes from 31 March 2026 with the Forms API](https://developers.google.com/workspace/forms/api/guides/api-changes-to-google-forms).

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*](https://www.pbainbridge.co.uk/2025/10/publish-google-form-to-your-domain.html)

---

*Published by [Phil Bainbridge](https://pulse.appsscript.info/p/author/phillipbainbridge/) on [Pulse](https://pulse.appsscript.info/). Original article: [https://pulse.appsscript.info/p/2025/10/community-tip-restrict-a-google-form-to-your-domain-with-apps-script/](https://pulse.appsscript.info/p/2025/10/community-tip-restrict-a-google-form-to-your-domain-with-apps-script/)*
