You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot retrieve validation rules for checkbox items in Google Forms API #562
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
functiongetFormData(formId){varform=FormApp.openById(formId);varitems=form.getItems();items.forEach(function(item){if(item.getType()===FormApp.ItemType.CHECKBOX){varcheckboxItem=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.
Activity