// Add a text item to a form and require it to be a number within a range.
const form = FormApp.create('My form');
const textItem =
form.addTextItem().setTitle('Pick a number between 1 and 100?');
const textValidation =
FormApp.createTextValidation()
.setHelpText('Input was not a number between 1 and 100.')
.requireNumberBetween(1, 100)
.build();
textItem.setValidation(textValidation);
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2024-12-03 UTC."],[[["`TextValidation` is used to apply specific data validation rules to text-based form responses collected through a `TextItem`."],["It enables defining criteria like number ranges, custom error messages (using `setHelpText`), and applying these constraints via `setValidation` on the target `TextItem`."],["The example demonstrates setting a numeric constraint, requiring user input to fall between 1 and 100 with a clear error message if the input is invalid."]]],[]]