TextValidation の DataValidationBuilder。
// 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);
メソッド
詳細なドキュメント
requireNumber()
requireNumberBetween(start, end)
テキスト項目が開始値と終了値の間の数値(両端を含む)であることを要求します。
パラメータ
| 名前 | タイプ | 説明 |
|---|---|---|
start | Number | 包括的な範囲の下限 |
end | Number | 包括的な範囲の上限 |
戻る
TextValidationBuilder - チェーン用の TextValidation
requireNumberEqualTo(number)
テキスト アイテムが指定された値と等しい数値であることを要求します。
パラメータ
| 名前 | タイプ | 説明 |
|---|---|---|
number | Number | アイテムが等しくなければならない値。 |
戻る
TextValidationBuilder - チェーン用の TextValidation
requireNumberGreaterThan(number)
テキスト アイテムが指定された値より大きい数値であることを要求します。
パラメータ
| 名前 | タイプ | 説明 |
|---|---|---|
number | Number | アイテムが超える必要がある値。 |
戻る
TextValidationBuilder - チェーン用の TextValidation
requireNumberGreaterThanOrEqualTo(number)
テキスト アイテムが指定された値以上の数値であることを要求します。
パラメータ
| 名前 | タイプ | 説明 |
|---|---|---|
number | Number | アイテムがそれ以上である必要がある値。 |
戻る
TextValidationBuilder - チェーン用の TextValidation
requireNumberLessThan(number)
テキスト アイテムが指定された値より小さい数値であることを要求します。
パラメータ
| 名前 | タイプ | 説明 |
|---|---|---|
number | Number | アイテムが超える必要がある値。 |
戻る
TextValidationBuilder - チェーン用の TextValidation
requireNumberLessThanOrEqualTo(number)
テキスト アイテムが指定された値以下の数値であることを要求します。
パラメータ
| 名前 | タイプ | 説明 |
|---|---|---|
number | Number | アイテムがそれ以下でなければならない値。 |
戻る
TextValidationBuilder - チェーン用の TextValidation
requireNumberNotBetween(start, end)
テキスト項目が開始値と終了値の間の数値(両端を含む)でないことを要求します。
パラメータ
| 名前 | タイプ | 説明 |
|---|---|---|
start | Number | 包括的な範囲の下限 |
end | Number | 包括的な範囲の上限 |
戻る
TextValidationBuilder - チェーン用の TextValidation
requireNumberNotEqualTo(number)
テキスト項目が指定された値と等しくない数値であることを要求します。
パラメータ
| 名前 | タイプ | 説明 |
|---|---|---|
number | Number | アイテムが等しくない値。 |
戻る
TextValidationBuilder - チェーン用の TextValidation
requireTextContainsPattern(pattern)
レスポンスにパターンが含まれている必要があります。
パラメータ
| 名前 | タイプ | 説明 |
|---|---|---|
pattern | String | テキストにパターンが含まれている必要があります |
戻る
TextValidationBuilder - チェーン用の this
requireTextDoesNotContainPattern(pattern)
レスポンスにパターンが含まれていないことを要求します。
パラメータ
| 名前 | タイプ | 説明 |
|---|---|---|
pattern | String | テキストにパターンを含めることはできません |
戻る
TextValidationBuilder - チェーン用の this
requireTextDoesNotMatchPattern(pattern)
レスポンスがパターンと一致しないことを要求します。
パラメータ
| 名前 | タイプ | 説明 |
|---|---|---|
pattern | String | テキストがパターンと一致しない |
戻る
TextValidationBuilder - チェーン用の this
requireTextIsEmail()
requireTextIsUrl()
requireTextLengthGreaterThanOrEqualTo(number)
レスポンスの長さが値以上であることを要求します。
パラメータ
| 名前 | タイプ | 説明 |
|---|---|---|
number | Integer | 段落テキストの長さがこの値より大きい必要があります |
戻る
TextValidationBuilder - チェーン用の this
requireTextLengthLessThanOrEqualTo(number)
レスポンスの長さが値より小さい必要があります。
パラメータ
| 名前 | タイプ | 説明 |
|---|---|---|
number | Integer | 段落テキストの長さはこの値以下にする必要があります |
戻る
TextValidationBuilder - チェーン用の this
requireTextMatchesPattern(pattern)
回答がパターンと一致している必要があります。
パラメータ
| 名前 | タイプ | 説明 |
|---|---|---|
pattern | String | テキストはパターンと一致している必要があります |
戻る
TextValidationBuilder - チェーン用の this