קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
DataValidationBuilder
ה-DataValidationBuilder הבסיסי שמכיל מגדירים למאפיינים שמשותפים לכל האימותים, כמו טקסט עזרה. משמש ליצירת אובייקטים של 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);
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 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"]]