Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Trình tạoXác thựcdữ liệu
DataValidationBuilder cơ sở chứa các phương thức setter cho các thuộc tính phổ biến cho tất cả các quy trình xác thực, chẳng hạn như văn bản trợ giúp. Dùng để tạo các đối tượng DataValadation.
//Addatextitemtoaformandrequireittobeanumberwithinarange.vartextItem=form.addTextItem().setTitle('Pick a number between 1 and 100?');vartextValidation=FormApp.createTextValidation().setHelpText(“Inputwasnotanumberbetween1and100.”).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-22 UTC."],[[["`DataValidationBuilder` facilitates the creation of data validation rules for form items, like ensuring a text input is a number within a specific range."],["It provides methods to set help text, which is displayed if validation fails, and ultimately builds a `DataValidation` object applied to the form item."],["Developers can utilize methods such as `requireNumberBetween()` to define specific validation criteria, and chain methods for streamlined implementation."],["The `build()` method finalizes the validation setup, generating a `DataValidation` object ready to be associated with a form item for enforcing data integrity."]]],["`DataValidationBuilder` constructs `DataValidation` objects, allowing the setting of common validation properties like help text. The `build()` method finalizes the `DataValidation` object. `copy()` duplicates the builder. `setHelpText(text)` assigns instructional text displayed when input is invalid. As illustrated, a text item can be set to only accept numbers within a defined range, displaying help text for incorrect input. This process creates validations in forms.\n"]]