Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Cannot retrieve validation rules for checkbox items in Google Forms API

オープン
#562 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

@PierrickVoulet がすでに取り組んでいます。

2025年9月22日 から。

評価

この issue はまだ評価されていません。

説明

Problem

Currently, Google Apps Script and Google Forms API do not provide a way to retrieve validation rules for checkbox items in Google Forms.

Current Behavior

When using FormApp.openById() and iterating through form items, checkbox items created with item.asCheckboxItem() do not expose any methods to access validation rules such as:

  • Minimum number of selections required
  • Maximum number of selections allowed
  • Custom validation messages

Expected Behavior

There should be methods available to retrieve validation rules for checkbox items, similar to how other form item types expose their validation settings.

Use Case

We need to programmatically read form structures including validation rules to:

  1. Display proper validation messages in custom form renderers
  2. Replicate form validation logic in external applications
  3. Generate form documentation that includes validation requirements

Code Example

function getFormData(formId) {
  var form = FormApp.openById(formId);
  var items = form.getItems();
  
  items.forEach(function(item) {
    if (item.getType() === FormApp.ItemType.CHECKBOX) {
      var checkboxItem = item.asCheckboxItem();
      
      // These methods don't exist but would be useful:
      // checkboxItem.getValidation()
      // checkboxItem.getMinSelections()
      // checkboxItem.getMaxSelections()
      // checkboxItem.getValidationHelpText()
    }
  });
}

Impact

This limitation prevents developers from creating comprehensive form processing tools and custom form UIs that need to respect the original form's validation rules.

Workaround

Currently, there is no known workaround to retrieve this information programmatically.

Environment

  • Google Apps Script
  • Google Forms API
  • FormApp service
主要言語
JavaScript
スター
5.2k
フォーク
2k
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

googleworkspace/apps-script-samples のほかの issue

googleworkspace/apps-script-samples の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。