message: get latest snippets
diff: @@ -81,6 +81,33 @@ items:
  return:
  type:
  - excel.Excel.ListDataValidation
  + description: |-
  +
  + #### Examples
  +
  + ```typescript
  + await Excel.run(async (context) => {
  + const sheet = context.workbook.worksheets.getItem("Decision");
  + const nameRange =
  + sheet.tables.getItem("NameOptionsTable").columns.getItem("Baby Name").getDataBodyRange();
  +
  + // When you are developing, it is a good practice to
  + // clear the dataValidation object with each run of your code.
  + nameRange.dataValidation.clear();
  +
  + const nameSourceRange = context.workbook.worksheets.getItem("Names").getRange("A1:A3");
  +
  + let approvedListRule = {
  + list: {
  + inCellDropDown: true,
  + source: '=Names!$A$1:$A$3'
  + }
  + };
  + nameRange.dataValidation.rule = approvedListRule;
  +
  + await context.sync();
  + });
  + ```
  - uid: excel.Excel.DataValidationRule.textLength
  summary: |-
  TextLength data validation criteria.
  @@ -126,3 +153,40 @@ items:
  return:
  type:
  - excel.Excel.BasicDataValidation
  + description: |-
  +
  + #### Examples
  +
  + ```typescript
  + await Excel.run(async (context) => {
  + const sheet = context.workbook.worksheets.getItem("Decision");
  + const rankingRange = sheet.tables.getItem("NameOptionsTable").columns.getItem("Ranking").getDataBodyRange();
  +
  + // When you are developing, it is a good practice to
  + // clear the dataValidation object with each run of your code.
  + rankingRange.dataValidation.clear();
  +
  + let greaterThanZeroRule = {
  + wholeNumber: {
  + formula1: 0,
  + operator: Excel.DataValidationOperator.greaterThan
  + }
  + };
  + rankingRange.dataValidation.rule = greaterThanZeroRule;
  +
  + rankingRange.dataValidation.prompt = {
  + message: "Please enter a positive number.",
  + showPrompt: true,
  + title: "Positive numbers only."
  + };
  +
  + rankingRange.dataValidation.errorAlert = {
  + message: "Sorry, only positive numbers are allowed",
  + showAlert: true,
  + style: "Stop",
  + title: "Negative Number Entered"
  + };
  +
  + await context.sync();
  + });
  + ```
  