Cannot retrieve validation rules for checkbox items in Google Forms API
@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:
- Display proper validation messages in custom form renderers
- Replicate form validation logic in external applications
- 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 はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
googleworkspace/apps-script-samples のほかの issue
-
Alvin Litana Mirasol オープン
難易度 5/5 1週間以上 初心者へのやさしさ 1/100
googleworkspace/apps-script-samples#659 · コメント 1 件 · リアクション 1 件 ·
-
Password reset オープン
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
googleworkspace/apps-script-samples#654 · リアクション 2 件 ·
-
cod gs オープン
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
googleworkspace/apps-script-samples#651 · リアクション 1 件 ·
-
tespogrome オープン
難易度 5/5 1週間以上 初心者へのやさしさ 1/100
googleworkspace/apps-script-samples#624 · リアクション 1 件 ·
-
googleworkspace/apps-script-samples#616 · 担当者 1 名 ·
googleworkspace/apps-script-samples の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
mksglu/context-mode#1200 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
neondatabase/website#5944 ·
-
module: core
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
bigbluebutton/bigbluebutton#25849 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
jaegertracing/jaeger-ui#4506 ·